GithubHelp home page GithubHelp logo

DB:pull 127 error about capistrano-db-tasks HOT 10 OPEN

sgruhier avatar sgruhier commented on July 4, 2024 8
DB:pull 127 error

from capistrano-db-tasks.

Comments (10)

smtlaissezfaire avatar smtlaissezfaire commented on July 4, 2024 2

I don't think the patch above works well, since it doesn't work in cases in which the db config can't easily been taken from database.yml (for instance, when database info is encrypted in secrets, etc).

For me, I ran into this one when using rvm. Rvm wasn't loading with the 'rails' command, so it wasn't found. Strange how it wasn't reporting anything out, though.

This fixed it for me:

set :rvm_map_bins, %w{gem rake ruby bundle rails}

from capistrano-db-tasks.

Fercell avatar Fercell commented on July 4, 2024

I am having the same issue, this is what logs say:

DEBUG [fc953976] Finished in 0.547 seconds with exit status 0 (successful). INFO Loading local database config INFO Loading local database config INFO Loading remote database config DEBUG [3b1a9656] Running if test ! -d /home/ubuntu/current; then echo "Directory does not exist '/home/ubuntu/current'" 1>&2; false; fi as $SERVER$ DEBUG [3b1a9656] Command: if test ! -d /home/ubuntu/current; then echo "Directory does not exist '/home/ubuntu/current'" 1>&2; false; fi DEBUG [3b1a9656] Finished in 0.243 seconds with exit status 0 (successful). DEBUG [61adb49d] Running bundle exec rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'" 2>/dev/null as $SERVER$ DEBUG [61adb49d] Command: cd /home/ubuntu/current && ( export RAILS_ENV="production" ; bundle exec rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'" 2>/dev/null )

from capistrano-db-tasks.

luizamboni avatar luizamboni commented on July 4, 2024

i m too.
Error running command (status=pid 5691 exit 1): /home/luiz/projects/exercicios_resolvidos5/bin/rails runner "puts '__CAPISTRANODB_CONFIG_BEGIN_FLAG__' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + '__CAPISTRANODB_CONFIG_END_FLAG__'"

ruby: 2.6
rails: 5.1
capistrano-db-tasks: 0.6

database: postgress in another machine

from capistrano-db-tasks.

Znow avatar Znow commented on July 4, 2024

@sgruhier - I get the same error, is there any updates on when this is gonna be fixed?

from capistrano-db-tasks.

impdesigns avatar impdesigns commented on July 4, 2024

I'm also experiencing the same behavior. db:pull fails unless I force version 0.4.

For me at least, this didn't start happening until I updated to Capistrano 3.8.1. Having said that, I'm not exactly a ruby on rails guru and that might have not a damn thing to do with anything...

from capistrano-db-tasks.

ezuk avatar ezuk commented on July 4, 2024

The fix above from @sauliusgrigaitis worked for me. Thank you!

from capistrano-db-tasks.

codered avatar codered commented on July 4, 2024

Can we merge this into master and create a new release?

I verified that @sauliusgrigaitis fix works.

from capistrano-db-tasks.

codered avatar codered commented on July 4, 2024

By the way, if you want to use the fix before they merge it into a release, you can do the following:

  1. In command prompt type "which rails"
  2. Change to the directory using the "cd" command.
  3. There is a gem folder. Traverse the folder until you find database.rb. Copy paste the file from the fix into there. This will make it work, however, the solution is temporary.

from capistrano-db-tasks.

smtlaissezfaire avatar smtlaissezfaire commented on July 4, 2024

See capistrano/rvm#56

from capistrano-db-tasks.

rystraum avatar rystraum commented on July 4, 2024

There are 2 issues here.

  1. For those who are using capistrano-rvm, make sure that you've set: set :rvm_map_bins, %w{gem rake ruby bundle rails}

This enables capistrano-db-tasks to run rails runner using the bins provided by RVM.

  1. For those who have things in the DB being loaded by Rails before running (eg. application settings saved in the DB, which doesn't exist yet, because you're trying to set-up the DB but you can't setup the DB because cap db:push doesn't work because rails runner doesn't run because of an application setting in the db, which doesn't exist yet...), this commit will fix it naively as it forgoes going through rails runner but instead assumes a config/database.yml being read.

This case will fail for those who have a different setup (e.g. creds in secrets.yml) (as #113 (comment) points out)

from capistrano-db-tasks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.