capistrano-db-tasks icon indicating copy to clipboard operation
capistrano-db-tasks copied to clipboard

Empty dump file

Open kiddrew opened this issue 9 years ago • 2 comments

My db:pull seems to be completing correctly, but the dump file is empty. Trace below:

INFO [2c0b7433] Running /usr/bin/env mkdir -p /var/www/ilf-cms/rvm1scripts/ as deploy@ilf-web1
INFO [2c0b7433] Finished in 0.241 seconds with exit status 0 (successful).
INFO Uploading /Users/andrew/.rvm/gems/ruby-2.3.0/gems/rvm1-capistrano3-1.4.0/script/rvm-auto.sh 100.0%
INFO [ec8db92c] Running /usr/bin/env chmod +x /var/www/ilf-cms/rvm1scripts/rvm-auto.sh as deploy@ilf-web1
INFO [ec8db92c] Finished in 0.224 seconds with exit status 0 (successful).
local {"adapter"=>"postgresql", "encoding"=>"unicode", "host"=>"localhost", "username"=>"andrew", "pool"=>5, "timeout"=>5000, "port"=>5432, "database"=>"ilfcms_development"}
Local database: ilfcms_development
Please enter answer (Are you sure you want to erase your local database with server database (y)es, (n)o  ? ): y
local {"adapter"=>"postgresql", "encoding"=>"unicode", "host"=>"localhost", "username"=>"andrew", "pool"=>5, "timeout"=>5000, "port"=>5432, "database"=>"ilfcms_development"}
INFO [61b37d37] Running /usr/bin/env cd /var/www/ilf-cms/current &&  pg_dump --no-acl --no-owner   | bzip2 - - > db/_2016-02-11-100826.sql.bz2 as deploy@ilf-web1
INFO [61b37d37] Finished in 0.242 seconds with exit status 0 (successful).
INFO Downloading db/_2016-02-11-100826.sql.bz2 100.0%
INFO leaving /var/www/ilf-cms/current/db/_2016-02-11-100826.sql.bz2 on the server (add "set :db_remote_clean, true" to deploy.rb to remove)
INFO executing local: bunzip2 -f db/_2016-02-11-100826.sql.bz2 &&  psql -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'ilfcms_development' AND pid <> pg_backend_pid();;"  -U andrew  -h localhost  -p 5432 ;  dropdb  -U andrew  -h localhost  -p 5432  ilfcms_development;  createdb  -U andrew  -h localhost  -p 5432  ilfcms_development;  psql  -U andrew  -h localhost  -p 5432  -d ilfcms_development < db/_2016-02-11-100826.sql
 pg_terminate_backend
----------------------
(0 rows)

INFO leaving db/_2016-02-11-100826.sql (specify :db_local_clean in deploy.rb to remove)
INFO Completed database import

kiddrew avatar Feb 11 '16 16:02 kiddrew

@kiddrew You can try to ssh to the server and run pg_dump ... command there. This way you will get the errors. In my case I have:

pg_dump: server version: 9.5.2; pg_dump version: 9.2.15
pg_dump: aborting because of server version mismatch

FUT avatar May 07 '16 16:05 FUT

I was helped by the update of the pg_dump utility. The version of the database server and pg_dump must match.

In my case, I had to execute the following command.

sudo ln -s /usr/pgsql-10/bin/pg_dump /usr/bin/pg_dump --force

abuhtoyarov avatar Apr 21 '19 11:04 abuhtoyarov