taps icon indicating copy to clipboard operation
taps copied to clipboard

Unable to fetch tables information from ...

Open adasfan opened this issue 12 years ago • 56 comments

I am trying to pull a db from MySQL into Postgres. "blogs" is the name of the one the tables in the db.

I see the error "Unable to fetch tables information from http://mcetin:secret@localhost:5000. Please check the server log" error message from the taps pull side.

Here is the call stack from the taps server side: localhost - - [24/Feb/2013:23:00:47 EST] "GET /sessions/8471611000/pull/table_names HTTP/1.1" 500 518

  • -> /sessions/8471611000/pull/table_names Rack::Utils::OkJson::Error - cannot encode Symbol: :blogs: /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in valenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:inblock in arrenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in map' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:inarrenc' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in encode' /.../.rvm/gems/ruby-1.9.3-p362/gems/taps-0.3.24/lib/taps/server.rb:157:inblock in class:Server' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:865:in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:865:inblock in route' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:521:in instance_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:521:inroute_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:500:in block (2 levels) in route!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:497:incatch' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:497:in block in route!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:476:ineach' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:476:in route!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:601:indispatch!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:411:in block in call!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:ininstance_eval' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:in block in invoke' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:incatch' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:566:in invoke' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:411:incall!' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:399:in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/deflater.rb:25:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:incall' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:979:in block in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:1005:insynchronize' /.../.rvm/gems/ruby-1.9.3-p362/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call' /.../.rvm/gems/ruby-1.9.3-p362/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:inservice' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:138:in service' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:94:inrun' /.../.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :blogs

adasfan avatar Feb 25 '13 04:02 adasfan

same problem here !

nsoufr avatar Feb 28 '13 19:02 nsoufr

FWIW I had a similar error:

ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations

I was running the taps command from a directory one level up from my app and was using my global gem set. My app is rails 3.1.3, and uses rmv to manage the gem set. So running one level up would have been using my global gemset.

Anyway, when I re-ran taps server and taps pull from inside my project directory, it worked fine.

jpwynn avatar Mar 04 '13 01:03 jpwynn

Same problem here! Didn't work from inside my project directory either :(

localhost - - [09/Mar/2013:06:13:21 EST] "GET /sessions/9685932778/pull/table_names HTTP/1.1" 500 529

  • -> /sessions/9685932778/pull/table_names OkJson::Error - cannot encode Symbol: :Audio:

drshizzle avatar Mar 09 '13 11:03 drshizzle

I just had the same issue and solved it by using exactly the gem versions specified in gemspec, rather than latest version allowed by gemspec. It seems that one of the gems had a regression and taps didn't update gemspec to exclude that version.

egilburg avatar Mar 15 '13 18:03 egilburg

Appears to work with rack 1.0.1 gem "rack", "1.0.1"

charliewilkins avatar Mar 16 '13 14:03 charliewilkins

@flingbob this fixed the problem for me.. thanks for the tip.

chadkouse avatar Mar 18 '13 05:03 chadkouse

What version of rails are you using? My app won't let me downgrade that far ...

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (= 3.2.11) ruby depends on
      rack (~> 1.4.0) ruby

    rack (1.0.1)

cheeby avatar Mar 27 '13 20:03 cheeby

Are you adding this to your Rails app's Gemfile? You don't have to, unless your Rails app depends on it during runtime (which I'd find unusual). Taps doesn't require Rails.

egilburg avatar Mar 27 '13 20:03 egilburg

ok, cool. Then from the command line how do I get taps to use a specific version of rack?

Thanks!

Steve

On Mar 27, 2013, at 3:58 PM, Eugene Gilburg [email protected] wrote:

Are you adding this to your Rails app's Gemfile? You don't have to, unless your Rails app depends on it during runtime (which I'd find unusual). Taps doesn't require Rails.

— Reply to this email directly or view it on GitHub.

cheeby avatar Mar 27 '13 21:03 cheeby

Run the command from a new folder not under Rails root, and add a separate Gemfile there?

egilburg avatar Mar 27 '13 21:03 egilburg

Hi again,

Yeah, tried that:

wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'

then ran bundle then ran the taps pull and got the same error.

How is it currently working for you? What's your set-up look like?

Thanks.

Steve

On Mar 27, 2013, at 4:03 PM, Eugene Gilburg [email protected] wrote:

Run the command from a new folder not under Rails root, and add a separate Gemfile there?

— Reply to this email directly or view it on GitHub.

cheeby avatar Mar 27 '13 21:03 cheeby

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox [email protected] wrote:

Hi again,

Yeah, tried that:

wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'

then ran bundle then ran the taps pull and got the same error.

How is it currently working for you? What's your set-up look like?

Thanks.

Steve

On Mar 27, 2013, at 4:03 PM, Eugene Gilburg [email protected] wrote:

Run the command from a new folder not under Rails root, and add a separate Gemfile there?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .

egilburg avatar Mar 27 '13 22:03 egilburg

Same error:

ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands

Tried with ruby 1.9.2 and 1.9.3.

Thanks,

Steve

On Mar 27, 2013, at 5:53 PM, Eugene Gilburg [email protected] wrote:

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox [email protected] wrote:

Hi again,

Yeah, tried that:

wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'

then ran bundle then ran the taps pull and got the same error.

How is it currently working for you? What's your set-up look like?

Thanks.

Steve

On Mar 27, 2013, at 4:03 PM, Eugene Gilburg [email protected] wrote:

Run the command from a new folder not under Rails root, and add a separate Gemfile there?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .

— Reply to this email directly or view it on GitHub.

cheeby avatar Mar 27 '13 23:03 cheeby

Any other suggestions?

Thanks,

Steve

On Mar 27, 2013, at 6:57 PM, Steve Fox [email protected] wrote:

Same error:

ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands

Tried with ruby 1.9.2 and 1.9.3.

Thanks,

Steve

On Mar 27, 2013, at 5:53 PM, Eugene Gilburg [email protected] wrote:

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox [email protected] wrote:

Hi again,

Yeah, tried that:

wiscota :: ~/ruby/temp 1 » cat Gemfile source 'https://rubygems.org' gem 'rack', '1.5.0'

then ran bundle then ran the taps pull and got the same error.

How is it currently working for you? What's your set-up look like?

Thanks.

Steve

On Mar 27, 2013, at 4:03 PM, Eugene Gilburg [email protected] wrote:

Run the command from a new folder not under Rails root, and add a separate Gemfile there?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/ricardochimal/taps/issues/128#issuecomment-15553618 .

— Reply to this email directly or view it on GitHub.

cheeby avatar Mar 28 '13 18:03 cheeby

Sorry, not sure then. Perhaps try using other exact gem versions as I posted earlier. If not, can't help you, sorry

egilburg avatar Mar 28 '13 19:03 egilburg

ok. Thanks.

On Mar 28, 2013, at 2:52 PM, Eugene Gilburg [email protected] wrote:

Sorry, not sure then. Perhaps try using other exact gem versions as I posted earlier. If not, can't help you, sorry

— Reply to this email directly or view it on GitHub.

cheeby avatar Mar 28 '13 20:03 cheeby

This worked for me.

  1. I went up one directory from my project directory then did the following
  2. gem install taps
  3. gem uninstall rack
  4. gem install rack --version 1.0.1

Then did the migration as before and it worked. I had rack 1.5.2 installed so I had to remove that and replace it with rack 1.0.1. I also reversed the above process once I was done to restore my gem versions to original state. I'm using ruby 2.0.0-p0 and rails 4.0.0.beta1

Ansh25 avatar Apr 02 '13 00:04 Ansh25

No luck. Followed your steps. I even created an empty Gemfile in there and added

gem 'rack','1.0.1'

and ran bundle.

I may check out options other than taps to pull this off, but will keep working on this, too.

Thanks,

Steve

On Apr 1, 2013, at 7:10 PM, Ansh25 [email protected] wrote:

This worked for me.

  1. I went up one directory from my project directory then did the following
  2. gem install taps
  3. gem uninstall rack
  4. gem install rack --version 1.0.1

Then did the migration as before and it worked. I had rack 1.5.2 installed so I had to remove that and replace it with rack 1.0.1. I also reversed the above process once I was done to restore my gem versions to original state. I'm using ruby 2.0.0-p0 and rails 4.0.0.beta1

— Reply to this email directly or view it on GitHub.

cheeby avatar Apr 02 '13 14:04 cheeby

@cheeby I encountered this issue as well. Starting with @Ansh25 's advice, I moved up a directory and created a new Gemfile with this:

gem 'rack','1.0.1'
gem 'taps'
gem 'sqlite3'
gem 'pg'

At first I tried just specifying rack, but taps was already configured with rack 1.5, so I added taps to my new gemfile. You also need to add the gems for the database drivers. For me I was migrating sqlite to pg. Once I bundle installed with this gemfile I was able to restart taps and run the pull. Hope that helps.

cameronbot avatar Apr 18 '13 03:04 cameronbot

@Ansh25 Worked perfectly - thanks!

admbtlr avatar May 07 '13 11:05 admbtlr

rack 1.5.2 was not working for me with the same error. I uninstalled it and installed back rack version 1.2.5 and it worked.

hector avatar May 13 '13 23:05 hector

Weird. On a completely different machine - brand new iMac - I've rebuilt the database, created a fresh postgresql database and then created a Gemfile in a new directory, added the items specified by @cameronbot and am getting the same error on doing a taps pull:

ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :brands

Any other insight is appreciated.

Thanks,

Steve

cheeby avatar May 15 '13 17:05 cheeby

@Ansh25 Thanks as well for your workaround! Worked perfectly!

bewinter avatar May 16 '13 11:05 bewinter

I added gem 'rack','1.0.1' to beginning of bin/taps, works well. Thank you

Paxa avatar May 26 '13 11:05 Paxa

@Paxa worked for me as well. Thanks.

kainage avatar Jun 20 '13 21:06 kainage

@Ansh25 worked great for me as well, thanks.

ZenCocoon avatar Jul 09 '13 10:07 ZenCocoon

This still does not seem to be fixed that well if you get the gem from rubydocs.

Here is what I did:

get out of your rails folder and make a folder called tmp.

cd temp

make a Gemfile containing and save it:

Put the following into the gemfile

source 'https://rubygems.org'

gem 'rack','1.0.1'
gem 'taps'
gem 'sqlite3'
gem 'pg'

run bundle from a terminal within that folder, which should give you results like this:

hak8or@ubuntu:~/tmp$ bundle
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using mime-types (1.23)
Using pg (0.15.1)
Installing rack (1.0.1)
Using rest-client (1.6.7)
Using sequel (3.20.0)
Using sinatra (1.0)
Using sqlite3 (1.3.7)
Installing taps (0.3.24)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

Copy the db folder from your rails application into your tmp folder, so now the folder contents should look like this:

Gemfile
Gemfile.lock
db

Now from the terminal within that folder run what you were doing earlier but add bundle exec. You should get something like this:

hak8or@ubuntu:~/tmp$ bundle exec taps server sqlite://db/development.sqlite3 hak8or secret
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2013-07-16 11:10:32] INFO  WEBrick 1.3.1
[2013-07-16 11:10:32] INFO  ruby 2.0.0 (2013-06-27) [x86_64-linux]
[2013-07-16 11:10:32] INFO  WEBrick::HTTPServer#start: pid=3765 port=5000

And from that point run everything like you would normally and it should work fine. This is what fixed it for me.

hak8or avatar Jul 16 '13 15:07 hak8or

@hak8or Worked perfectly for me, thanks a lot

MaxCloutier avatar Aug 15 '13 13:08 MaxCloutier

@hak8or This did the trick for me as well. Thanks.

zakstern avatar Sep 14 '13 05:09 zakstern

@hak8or Thanks so much.

MCodyB avatar Sep 18 '13 19:09 MCodyB