Error dumping database when restore


(Octopus) #1

When I restore my discourse, I got following failed information

[2015-11-16 02:24:59] Enabling readonly mode...
[2015-11-16 02:24:59] Pausing sidekiq...
[2015-11-16 02:24:59] Waiting for sidekiq to finish running jobs...
[2015-11-16 02:24:59] Switching schemas... try reloading the site in 5 minutes, if successful, then reboot and restore is complete.
[2015-11-16 02:24:59] Migrating the database...
[2015-11-16 02:25:02] EXCEPTION: Error dumping database
[2015-11-16 02:25:02] /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `structure_dump'
/opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/tasks/database_tasks.rb:150:in `structure_dump'
/opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/railties/databases.rake:270:in `block (3 levels) in <top (required)>'

Is there a way around this ?


(Régis Hanol) #2

Hmm, I’ve never seen that one before :frowning: Can you run a rake db:migrate inside the container?


(Octopus) #3

I can use RAILS_ENV=production bundle exec ruby rake db:create db:migrate to generate a new DB.
I found a method into postgresql_database_tasks.rb of kernel.system('pg_dump -i -s -x -O -f /opt/bitnami/apps/discourse/htdocs/db/structure.sql bitnami_discourse" bitnami_discourse') always return False, so it will raise Error dumping database exception.


(Jeff Atwood) #4

If this is a Bitnami install, all bets are off; they have customized the code and install in a way that we can’t support. Sorry. We can only support the official Docker based install here.


(Octopus) #5

OK, thanks sob:sob:sob: