-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to fetch tables information from ... #128
Comments
same problem here ! |
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. |
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
|
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. |
Appears to work with rack 1.0.1 |
@flingbob this fixed the problem for me.. thanks for the tip. |
What version of rails are you using? My app won't let me downgrade that far ...
|
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. |
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:
|
Run the command from a new folder not under Rails root, and add a separate Gemfile there? |
Hi again, Yeah, tried that: wiscota :: ~/ruby/temp 1 » cat Gemfile then ran bundle 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:
|
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:
|
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:
|
Any other suggestions? Thanks, Steve On Mar 27, 2013, at 6:57 PM, Steve Fox [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 |
ok. Thanks. On Mar 28, 2013, at 2:52 PM, Eugene Gilburg [email protected] wrote:
|
This worked for me.
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 |
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:
|
@cheeby I encountered this issue as well. Starting with @Ansh25 's advice, I moved up a directory and created a new Gemfile with this:
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. |
@Ansh25 Worked perfectly - thanks! |
rack 1.5.2 was not working for me with the same error. |
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 |
@Ansh25 Thanks as well for your workaround! Worked perfectly! |
I added |
@Paxa worked for me as well. Thanks. |
@Ansh25 worked great for me as well, thanks. |
Taps uses a customized version of OkJson to exchange data between the client and server. This customized version silently converts symbols to strings as a convience (the original OkJson considers encoding symbols an error since symbols are not a type supported by JSON). Rack started using OkJson also to encode data but kept the original symantics. Since the Taps::Server inherits from Sinatra::Base, and Sinatra::Base includes Rack::Utils, and Rack::Utils is the namespace where Rack's version of OkJson is installed this means the Rack version is now being used by taps instead of the taps version. This means when symbols are encoded an error is generated. To restore the original behavior this patch explicility references the taps version of OkJson. This fixes issue ricardochimal#128.
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.
make a Gemfile containing and save it: Put the following into the gemfile
run bundle from a terminal within that folder, which should give you results like this:
Copy the db folder from your rails application into your tmp folder, so now the folder contents should look like this:
Now from the terminal within that folder run what you were doing earlier but add bundle exec. You should get something like this:
And from that point run everything like you would normally and it should work fine. This is what fixed it for me. |
@hak8or Worked perfectly for me, thanks a lot |
@hak8or Thanks so much. |
@MaxCloutier @zakstern @MCodyB You are all most welcome! :) |
@Ansh25 Thank you!!! |
@cameronbot & @hak8or thank you!! |
Taps uses a customized version of OkJson to exchange data between the client and server. This customized version silently converts symbols to strings as a convience (the original OkJson considers encoding symbols an error since symbols are not a type supported by JSON). Rack started using OkJson also to encode data but kept the original symantics. Since the Taps::Server inherits from Sinatra::Base, and Sinatra::Base includes Rack::Utils, and Rack::Utils is the namespace where Rack's version of OkJson is installed this means the Rack version is now being used by taps instead of the taps version. This means when symbols are encoded an error is generated. To restore the original behavior this patch explicility references the taps version of OkJson. This fixes issue ricardochimal#128.
@Ansh25 Worked, thank you for ending days of aggravation. |
You can add add gem 'rack',’1.0.1’ to gemfile and run bundle update rack. This worked for me. Thanks guys. |
@alagram's suggestion worked for me. thanks! |
I have tried @hak8or but when I run taps from the temp/ folder I see that rack is still on version 1.5.2 which is the latest version I have installed. In the Gemfile.lock it is clear
But when I run taps
As you can see, rack is on version 1.5.2 If I see what versions of rack I have installed,
But I would not like to uninstall other versions, since I fear this could affect other projects I have in the same machine... Is there anyway I can enforce taps to use rack 1.0.1? thank you for your help -- UPDATE -- Ok I just found the solution, use
|
@Ansh25 Your suggestion worked for me as well. Thanks! |
Very late, but I figured I would update my fix and do some formatting with your information. |
@Ansh25 Your solution works a charm. Cheers! |
Added gem 'rack','1.0.1' to beginning of bin/taps. This worked like a charm. Thank you. |
@hak8or thanks! worked well for me! |
I tried every possible way to do this, but everytime I am having the same problem I tried to follow hak8or advice I am using rails 4.1 and ruby 2.1.1 |
@Paxa's solution is the easiest
|
@hak8or thanks a million! worked brilliantly for me. |
@hak8or Worked like charm! Thanks! |
Another thanks to @hak8or ! |
@hak8or Thank you so much |
@hak8or Thanks! |
@Paxa what does this mean?
taps is a ruby script, adding that line is a syntax error. |
@joshco, this will make rubygems load rack version 1.0.1, otherwise it will load latest version of gem installed on machine |
This still doesn't make sense. bin/taps is a ruby script. You can't put a gem statement inside a ruby script. Do you mean to say put that in your Gemfile? |
ah. my bad. |
May be there is a better tool, did you see http://pgloader.io/ ? |
Ah. thanks for the tip. I will try it On Fri, Feb 20, 2015 at 12:58 PM, Pavel [email protected] wrote:
_Josh Co_hen [email protected] | @joshco | LinkedIn In the LGBT community, Domestic Abuse is the friendly-fire equivalent of Let's stop it. Please help |
Taps uses a customized version of OkJson to exchange data between the client and server. This customized version silently converts symbols to strings as a convience (the original OkJson considers encoding symbols an error since symbols are not a type supported by JSON). Rack started using OkJson also to encode data but kept the original symantics. Since the Taps::Server inherits from Sinatra::Base, and Sinatra::Base includes Rack::Utils, and Rack::Utils is the namespace where Rack's version of OkJson is installed this means the Rack version is now being used by taps instead of the taps version. This means when symbols are encoded an error is generated. To restore the original behavior this patch explicility references the taps version of OkJson. This fixes issue ricardochimal#128.
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
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:in
block 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:in
arrenc'/.../.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:in
block 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:in
block 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:in
route_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:in
catch'/.../.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:in
each'/.../.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:in
dispatch!'/.../.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:in
instance_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:in
catch'/.../.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:in
call!'/.../.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:in
call'/.../.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:in
call'/.../.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:in
synchronize'/.../.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:in
service'/.../.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:in
run'/.../.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
The text was updated successfully, but these errors were encountered: