ricardochimal / taps

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

Unable to fetch tables information from ... #128

Open adasfan opened 11 years ago

adasfan commented 11 years ago

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

nsoufr commented 11 years ago

same problem here !

jpwynn commented 11 years ago

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.

drshizzle commented 11 years ago

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

egilburg commented 11 years ago

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.

charliewilkins commented 11 years ago

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

chadkouse commented 11 years ago

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

cheeby commented 11 years ago

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)
egilburg commented 11 years ago

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.

cheeby commented 11 years ago

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 notifications@github.com 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.

egilburg commented 11 years ago

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

cheeby commented 11 years ago

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 notifications@github.com 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.

egilburg commented 11 years ago

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com 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 notifications@github.com 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 .

cheeby commented 11 years ago

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 notifications@github.com wrote:

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com 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 notifications@github.com 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 commented 11 years ago

Any other suggestions?

Thanks,

Steve

On Mar 27, 2013, at 6:57 PM, Steve Fox steve@wiscota.com 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 notifications@github.com wrote:

Change rack to 1.0.1 in that Gemfile you just created

On Wed, Mar 27, 2013 at 2:15 PM, steve fox notifications@github.com 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 notifications@github.com 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.

egilburg commented 11 years ago

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

cheeby commented 11 years ago

ok. Thanks.

On Mar 28, 2013, at 2:52 PM, Eugene Gilburg notifications@github.com 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.

Ansh25 commented 11 years ago

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

cheeby commented 11 years ago

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 notifications@github.com 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.

cameronbot commented 11 years ago

@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.

admbtlr commented 11 years ago

@Ansh25 Worked perfectly - thanks!

hector commented 11 years ago

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.

cheeby commented 11 years ago

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

bewinter commented 11 years ago

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

Paxa commented 11 years ago

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

kainage commented 11 years ago

@Paxa worked for me as well. Thanks.

ZenCocoon commented 11 years ago

@Ansh25 worked great for me as well, thanks.

hak8or commented 11 years ago

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.

MaxCloutier commented 11 years ago

@hak8or Worked perfectly for me, thanks a lot

zakstern commented 11 years ago

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

MCodyB commented 11 years ago

@hak8or Thanks so much.

hak8or commented 11 years ago

@MaxCloutier @zakstern @MCodyB You are all most welcome! :)

josephchan91 commented 11 years ago

@Ansh25 Thank you!!!

Amephist commented 11 years ago

@cameronbot & @hak8or thank you!!

sullysaurus commented 11 years ago

@Ansh25 Worked, thank you for ending days of aggravation.

alagram commented 10 years ago

You can add add gem 'rack',’1.0.1’ to gemfile and run bundle update rack. This worked for me. Thanks guys.

JGrubb commented 10 years ago

@alagram's suggestion worked for me. thanks!

idejuan commented 10 years ago

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

$ cat Gemfile.lock 
GEM
  remote: https://rubygems.org/
  specs:
    mime-types (2.0)
    pg (0.15.1)
    rack (1.0.1)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    sequel (3.20.0)
    sinatra (1.0)
      rack (>= 1.0)
    sqlite3 (1.3.8)
    taps (0.3.24)
      rack (>= 1.0.1)
      rest-client (>= 1.4.0, < 1.7.0)
      sequel (~> 3.20.0)
      sinatra (~> 1.0.0)

PLATFORMS
  ruby

DEPENDENCIES
  pg (= 0.15.1)
  rack (= 1.0.1)
  sqlite3
  taps

But when I run taps

$ taps server sqlite://db/development.sqlite3 root root
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2013-12-17 17:12:00] INFO  WEBrick 1.3.1
[2013-12-17 17:12:00] INFO  ruby 2.0.0 (2013-06-27) [x86_64-darwin12.3.0]
[2013-12-17 17:12:00] INFO  WEBrick::HTTPServer#start: pid=5544 port=5000
127.0.0.1 - root [17/Dec/2013 17:12:08] "GET / HTTP/1.1" 200 - 0.0012
localhost - - [17/Dec/2013:17:12:08 CET] "GET / HTTP/1.1" 200 31
- -> /
127.0.0.1 - root [17/Dec/2013 17:12:08] "POST /sessions HTTP/1.1" 200 - 0.0051
localhost - - [17/Dec/2013:17:12:08 CET] "POST /sessions HTTP/1.1" 200 46
- -> /sessions
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /Users/idejuan/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'

As you can see, rack is on version 1.5.2

If I see what versions of rack I have installed,

$ gem uninstall 'rack'

Select gem to uninstall:
 1. rack-1.0.1
 2. rack-1.4.4
 3. rack-1.4.5
 4. rack-1.5.2
 5. All versions
> 

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 bundle exec before the command taps

bundle exec taps server sqlite://db/development.sqlite3 root root
martinvelez commented 10 years ago

@Ansh25 Your suggestion worked for me as well. Thanks!

hak8or commented 10 years ago

@idejuan

Very late, but I figured I would update my fix and do some formatting with your information.

ssosina commented 10 years ago

@Ansh25 Your solution works a charm. Cheers!

Chryus commented 10 years ago

Added gem 'rack','1.0.1' to beginning of bin/taps. This worked like a charm. Thank you.

zezantam commented 10 years ago

@hak8or thanks! worked well for me!

logan99 commented 10 years ago

I tried every possible way to do this, but everytime I am having the same problem Failed to connect to database: Sequel::DatabaseConnectionError -> PG::ConnectionBad: fe_sendauth: no password supplied

I tried to follow hak8or advice The gem file looks same as that of hak8or but the gemfile.lock give different versions of the the gem installed. Any fullproof solution to the problem?

I am using rails 4.1 and ruby 2.1.1

emaillenin commented 10 years ago

@Paxa's solution is the easiest

asciant commented 10 years ago

@hak8or thanks a million! worked brilliantly for me.

ghost commented 10 years ago

@hak8or Worked like charm! Thanks!

joelbarker2011 commented 9 years ago

Another thanks to @hak8or !

sibor94 commented 9 years ago

@hak8or Thank you so much

Ligerlilly commented 9 years ago

@hak8or Thanks!

joshco commented 9 years ago

@paxa what does this mean?

Add gem 'rack','1.0.1' to bin/taps

taps is a ruby script, adding that line is a syntax error.