Comments (11)
@karlingen Can you try pull database with this PR: #70 ? Is it helpful?
from capistrano-db-tasks.
@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.
@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.
@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.
@karlingen my fault - forgot to stringify keys of database config. fixed
from capistrano-db-tasks.
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.
@numbata anything new here?
from capistrano-db-tasks.
@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.
Nice guess, but (un)fortunately we don't have any special characters in our
password.
from capistrano-db-tasks.
@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.
@karlingen PR #70 merged. Please, reopen this issue if you still have error.
from capistrano-db-tasks.
Related Issues (20)
- undefined method `zone' for Time:Class HOT 2
- NoMethodError: undefined method `zone' for Time:Class HOT 2
- SSHKit::Runner::ExecuteError "rails exit status: 127" in versions 0.5 and 0.6 HOT 11
- Net::SCP failure when db_dump_dir is set HOT 2
- NoMethodError: undefined method `[]' for nil:NilClass HOT 1
- DB:pull 127 error HOT 10
- how do I pass credentials to pg_dump?
- Option to drop database before import HOT 2
- Note in Docs for use with capistrano-rvm
- istrano HOT 2
- cap staging db:pull causes this problem :( HOT 2
- Serial id lost after db push HOT 2
- scp should happen before remote clean HOT 1
- Doesn't work on winows 10 sub-systems (/usr/bin/env: ‘ruby.exe’: No such file or directory)
- Strip adapter check? HOT 2
- Can not accept `db_dump_dir` configuration HOT 1
- Append the `db:download` task
- Multi database support is broken
- Question to users HOT 2
- `db_ignore_data_tables` setting doesn't work on MySQL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-db-tasks.