GithubHelp home page GithubHelp logo

Comments (11)

numbata avatar numbata commented on June 25, 2024

@karlingen Can you try pull database with this PR: #70 ? Is it helpful?

from capistrano-db-tasks.

karlingen avatar karlingen commented on June 25, 2024

@numbata Thanks for your reply. But unfortunately, it didn't work.

It just waits for password input:

$ cap production db:pull
DEBUG [394a7e4a] Running /usr/bin/env [ -d /home/deploy/.rbenv/versions/2.2.0 ] as [email protected]
..
[1a5735fc] Command: cd /home/deployer/awesome_app/current &&  pg_dump --no-acl --no-owner  -h localhost  awesome_app_production | bzip2 - - > db/awesome_app_production_2015-10-12-095702.sql.bz2
DEBUG [1a5735fc]  perl: warning: Setting locale failed.
DEBUG [1a5735fc]  perl: warning: Please check that your locale settings:
DEBUG [1a5735fc]    LANGUAGE = (unset),
DEBUG [1a5735fc]    LC_ALL = (unset),
DEBUG [1a5735fc]    LC_CTYPE = "UTF-8",
DEBUG [1a5735fc]    LANG = "en_US.UTF-8"
DEBUG [1a5735fc]      are supported and installed on your system.
DEBUG [1a5735fc]  perl: warning: Falling back to the standard locale ("C").
DEBUG [1a5735fc]  Password:
^C(Backtrace restricted to imported tasks)
cap aborted!

from capistrano-db-tasks.

numbata avatar numbata commented on June 25, 2024

@karlingen hmm. That's strange, because in PR #70 capistrano-db-tasks execute rails on remote server with all remote ENV variables to get remote database configuration (this line).

Can i ask you to debug my PR and make sure, that @config contains your production database config put puts @config under this line?

from capistrano-db-tasks.

karlingen avatar karlingen commented on June 25, 2024

@numbata It was my bad! I forgot to prefix it with bundle exec. Running bundle exec cap production db:pull worked but resulted in a different error:

$ bundle exec cap production db:pull
..
[7ccbfc68] Running /home/deployer/.rbenv/bin/rbenv exec bundle exec rails runner "puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml" 2>/dev/null as [email protected]
DEBUG [7ccbfc68] Command: cd /home/deployer/awesome_app/current && ( RBENV_ROOT=/home/deployer/.rbenv RBENV_VERSION=2.2.0 RAILS_ENV=production /home/deployer/.rbenv/bin/rbenv exec bundle exec rails runner "puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml" 2>/dev/null )
DEBUG [7ccbfc68]  ---
DEBUG [7ccbfc68]  :database: awesome_app_production
DEBUG [7ccbfc68]  :pool: 25
DEBUG [7ccbfc68]  :username: awesome_app_production_user
DEBUG [7ccbfc68]  :password: masked_password
DEBUG [7ccbfc68]  :host: localhost
DEBUG [7ccbfc68]  :adapter: postgresql
DEBUG [7ccbfc68]  :encoding: unicode
DEBUG [7ccbfc68] Finished in 7.239 seconds with exit status 0 (successful).
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: Only mysql or postgresql on remote and local server is supported

Only mysql or postgresql on remote and local server is supported

Tasks: TOP => db:pull => db:local:sync
(See full trace by running task with --trace)

I am running postgresql on both local and production server.

from capistrano-db-tasks.

numbata avatar numbata commented on June 25, 2024

@karlingen my fault - forgot to stringify keys of database config. fixed

from capistrano-db-tasks.

karlingen avatar karlingen commented on June 25, 2024

Next error:

DEBUG [432a8883] Running /home/deployer/.rbenv/bin/rbenv exec bundle exec rails runner "puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml" as karmet@localhost
DEBUG [432a8883] Command: ( RBENV_ROOT=/home/deployer/.rbenv RBENV_VERSION=2.2.0 /home/deployer/.rbenv/bin/rbenv exec bundle exec rails runner "puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml" )
DEBUG [432a8883]  sh: /home/deployer/.rbenv/bin/rbenv: No such file or directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rails exit status: 32512
rails stdout: Nothing written
rails stderr: sh: /home/deployer/.rbenv/bin/rbenv: No such file or directory

SSHKit::Command::Failed: rails exit status: 32512
rails stdout: Nothing written
rails stderr: sh: /home/deployer/.rbenv/bin/rbenv: No such file or directory

Tasks: TOP => db:pull => db:local:sync
(See full trace by running task with --trace)

from capistrano-db-tasks.

karlingen avatar karlingen commented on June 25, 2024

@numbata anything new here?

from capistrano-db-tasks.

ThomasBush avatar ThomasBush commented on June 25, 2024

@karlingen - This may be a moonshot, but does you database password happen to contain a single quote in it?

I use randomly generated pws for everything and this just occurred for me. If this is the case the single quote ends the input of your pw (which is passed as a single quoted string) in the script line early causing weird errors. I have to imagine this is a rare scenario, but figured it was worth pointing out as I had to dig for quite a while to notice it.

from capistrano-db-tasks.

karlingen avatar karlingen commented on June 25, 2024

Nice guess, but (un)fortunately we don't have any special characters in our
password.

from capistrano-db-tasks.

numbata avatar numbata commented on June 25, 2024

@karlingen is it actual for you? I make a lot of changes in PR #70. Can you check them?
Sorry for bump this necroissues 💀

from capistrano-db-tasks.

numbata avatar numbata commented on June 25, 2024

@karlingen PR #70 merged. Please, reopen this issue if you still have error.

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.