ricardochimal / taps

simple database import/export app
MIT License
1.2k stars 139 forks source link

heroku db:push for a spree app #45

Open miheir opened 14 years ago

miheir commented 14 years ago

I am trying to push a regular spree database with sample data to heroku. The app works fine on the local host.

$ heroku db:push Loaded Taps v0.3.11 Auto-detected local database: postgres://postgres@127.0.0.1/db/development?encod ing=utf8 Warning: Data in the app 'blooming-mist-92' will be overwritten and will not be recoverable. Are you sure you wish to continue? (y/n)? y Sending schema Schema: 100% |==========================================| Time: 00:19:49 Sending indexes schema_migrat: 100% |==========================================| Time: 00:00:00 assets: 100% |==========================================| Time: 00:00:01 ...

users: 100% |==========================================| Time: 00:00:00 Sending data 53 tables, 3,286 records countries: 0% | | ETA: --:--:-- Saving session to push_201008072116.dat.. !!! Caught Server Exception HTTP CODE: 500 Taps Server Error: undefined method size' for nil:NilClass /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/json-1.2.0/lib/json/pure/parser.rb:91:in initialize'...

I've tried using mysql and sqlite3 databases and was getting the same error. Any ideas on how to fix this?

ricardochimal commented 14 years ago

can you paste the out put of "gem list" and also send me a db dump of your postgres database? that should help me figure it out

ricardochimal commented 14 years ago

also what ruby version do you use locally

miheir commented 14 years ago

my ruby verion is 1.9.2dev preview3 gem list: abstract (1.0.0) actionmailer (3.0.0.rc, 2.3.8, 2.3.5) actionpack (3.0.0.rc, 2.3.8, 2.3.5) activemerchant (1.5.1) activemodel (3.0.0.rc) activerecord (3.0.0.rc, 2.3.8, 2.3.5) activerecord-tableless (0.1.0) activeresource (3.0.0.rc, 2.3.8, 2.3.5) activesupport (3.0.0.rc, 2.3.8, 2.3.5) arel (0.4.0) authlogic (2.1.3) authlogic-oid (1.0.4) aws-s3 (0.6.2) builder (2.1.2) bundler (1.0.0.rc.2) chronic (0.2.3) configuration (1.1.0) erubis (2.6.6) factory_girl (1.2.3) faker (0.3.1) heroku (1.9.13) highline (1.5.1) hoe (2.6.1) i18n (0.4.1) json_pure (1.4.3) launchy (0.3.7) less (1.2.20) mail (2.2.5) mime-types (1.16) minitest (1.6.0) mutter (0.5.3) paperclip (2.3.1.1) pg (0.9.0 x86-mingw32) polyglot (0.3.1) postgres-pr (0.6.3) rack (1.2.1, 1.1.0, 1.0.1) rack-mount (0.6.9) rack-test (0.5.4) rails (3.0.0.rc, 2.3.8, 2.3.5) railties (3.0.0.rc) rake (0.8.7) rdoc (2.5.8) rest-client (1.4.2) right_aws (2.0.0) right_http_connection (1.2.4) ruby-openid (2.1.8) ruby-postgres (0.7.1.2006.04.06 mswin32 rubyforge (2.0.4) searchlogic (2.3.5) sequel (3.13.0) shoulda (2.10.2) sinatra (1.0) spree (0.11.0) sqlite3-ruby (1.3.1 x86-mingw32) state_machine (0.8.0) stringex (1.0.3) taps (0.3.11) test-unit (2.0.9) thor (0.14.0) treetop (1.4.8) tzinfo (0.3.22) whenever (0.3.7) will_paginate (2.3.11) xml-simple (1.0.12)

postgres dump: http://www.4shared.com/file/aKWYvrjq/development.html

sqlite3: http://www.4shared.com/file/JXocPenf/developmentsqlite3.html

tpc commented 14 years ago

hola Ricardo, I see the same error message when I try to run "heroku db:push", and the problem comes up when taps is trying to send data from a table. I've included the url to my dump file, the screen output, as well as my ruby version & gem list:

http://cryptic.com/allyourbase/taps/passages_dump.txt

$ heroku db:push Loaded Taps v0.3.12 Auto-detected local database: mysql://root@localhost/test_app_dev?encoding=utf8 Warning: Data in the app 'floating-galaxy-71' will be overwritten and will not be recoverable. Are you sure you wish to continue? (y/n)? y Sending schema Schema: 100% |==========================================| Time: 00:00:11 Sending indexes schema_migrat: 100% |==========================================| Time: 00:00:01 Sending data 2 tables, 51 records passages: 0% | | ETA: --:--:-- Saving session to push_201009180356.dat.. !!! Caught Server Exception HTTP CODE: 500 Taps Server Error: undefined method `size' for nil:NilClass /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/json-1.2.0/lib/json/pure/parser.rb:91:in`initialize'/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/json-1.2.0/lib/json/common.rb:123:in `new'/usr /ruby1.8.7/lib/ruby/gems/1.8/gems/json-1.2.0/lib/json/common.rb:123:in`parse'./lib/taps/data_stream.rb:181:in `parse_json'./lib/taps/server.rb:49:in`POST /sessions/:key/push /table'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:863:in `call'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base. rb:863:in`route'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1. 0/lib/sinatra/base.rb:521:in`route_eval'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `route!'/home/slugs/150602_f9cc766_e312/mnt/.gem s/gems/sinatra-1.0/lib/sinatra/base.rb:497:in`catch'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `route!'/home/slugs/150602_f9cc766_e 312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:476:in`each'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'/home/slugs/15060 2_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:601:in`dispatch!'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'/h ome/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:566:in`instance_eval'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base. rb:566:in `invoke'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:566:in`catch'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/s inatra/base.rb:566:in `invoke'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:411:in`call!'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinat ra-1.0/lib/sinatra/base.rb:399:in `call'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/rack-1.1.0/lib/rack/auth/basic.rb:25:in`call'/home/slugs/150602_f9cc766_e312/mnt/.gems/ gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in`synchronize'/home/slugs/150602_f9cc76 6_e312/mnt/.gems/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'/home/heroku_rack/lib/static_assets.rb:9:in`call'/home/heroku_rack/lib/last_access.rb:15:in `call'/home/slu gs/150602_f9cc766_e312/mnt/.gems/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in`call'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `each'/home/ slugs/150602_f9cc766_e312/mnt/.gems/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in`call'/home/heroku_rack/lib/date_header.rb:14:in `call'/home/slugs/150602_f9cc766_e312/mnt/.gems/g ems/rack-1.1.0/lib/rack/builder.rb:77:in`call'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/connection.rb:76:in `pre_process'/home/slugs/150602_f9cc766_e 312/mnt/.gems/gems/thin-1.2.7/lib/thin/connection.rb:74:in`catch'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'/home/slu gs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/connection.rb:57:in`process'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/connection.rb:42:in ` receive_data'/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in`run_machine'/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/ eventmachine.rb:256:in `run'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in`start'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thi n-1.2.7/lib/thin/server.rb:156:in `start'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in`start'/home/slugs/150602_f9cc766_e 312/mnt/.gems/gems/thin-1.2.7/lib/thin/runner.rb:177:in `send'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/runner.rb:177:in`run_command'/home/slugs/1506 02_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'/home/slugs/150602_f9cc766_e312/mnt/.gems/gems/thin-1.2.7/bin/thin:6/usr/ruby1.8.7/bin/thin:19:in`lo ad'/usr/ruby1.8.7/bin/thin:19 tpc@LAPTOP ~/Desktop/temporary/test_app (master)

tpc@LAPTOP ~/Desktop/temporary/test_app (master) $ ruby -v ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

tpc@LAPTOP ~/Desktop/temporary/test_app (master) $ gem list

* LOCAL GEMS *

abstract (1.0.0) actionmailer (3.0.0) actionpack (3.0.0) activemodel (3.0.0) activerecord (3.0.0) activeresource (3.0.0) activesupport (3.0.0) arel (1.0.1) builder (2.1.2) bundler (1.0.0) configuration (1.1.0) cucumber (0.8.5) cucumber-rails (0.3.2) database_cleaner (0.5.2) diff-lcs (1.1.2) erubis (2.6.6) gherkin (2.2.0 i386-mingw32, 2.1.5 i386-mingw32) heroku (1.10.2) i18n (0.4.1) json_pure (1.4.6) launchy (0.3.7) mail (2.2.6) mime-types (1.16) minitest (1.7.1, 1.6.0) mysql (2.8.1 x86-mingw32) nokogiri (1.4.3.1 x86-mingw32) polyglot (0.3.1) rack (1.2.1) rack-mount (0.6.13) rack-test (0.5.4) rails (3.0.0) railties (3.0.0) rake (0.8.7) rdoc (2.5.11, 2.5.8) rest-client (1.4.2) rspec (1.3.0) rspec-rails (1.3.2) sequel (3.15.0) sinatra (1.0) sqlite3-ruby (1.3.1 x86-mingw32) taps (0.3.12) term-ansicolor (1.0.5) thor (0.14.0) treetop (1.4.8) trollop (1.16.2) tzinfo (0.3.23) webrat (0.7.1) win32console (1.3.0 x86-mingw32)

tpc@LAPTOP ~/Desktop/temporary/test_app (master) $

ricardochimal commented 14 years ago

can you send me a mysql dump of your data so I can test locally ?

tpc commented 14 years ago

Ricardo, apologies, I initially gave you a table dump, but here you are:

http://cryptic.com/allyourbase/taps/test_app_dev.txt

tpc commented 13 years ago

hola Ricardo, so I ran into a variation of the same problem. I am on Ruby 1.9.2, Rails3, and today, I upgraded heroku and taps:

$ gem update taps heroku Updating installed gems Updating heroku Successfully installed heroku-1.10.14 Updating taps Successfully installed taps-0.3.13 Gems updated: heroku, taps

I still get a similar error as before, but now, after upgrading, and using the following incantations:

heroku db:push heroku db:push mysql://root:mypass@localhost/mydb heroku db:push mysql://root:mypass@localhost/mydb?encoding=utf8 --force --tables mytable

Note the different method 'encoding' instead of 'size' for all three:

!!! Caught Server Exception HTTP CODE: 500 Taps Server Error: undefined method `encoding' for nil:NilClass