Problems after rollback database attempt

(Gökhan Gurbetoğlu) #1

Hi. I have tried to rollback database from the upgrade in admin panel but then my instance of discourse has failed.
I tried to rebuild with ./launcher rebuild app but it failed to build the bootstrap every time:

Bootstrap Error Output
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2019-02-06T14:12:09.974132 #14]  INFO -- : Purging temp files
Bundling assets

I, [2019-02-06T14:12:09.976018 #14]  INFO -- : Terminating async processes
I, [2019-02-06T14:12:09.976263 #14]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 185
185:signal-handler (1549462329) Received SIGTERM scheduling shutdown...
185:M 06 Feb 14:12:09.989 # User requested shutdown...
185:M 06 Feb 14:12:09.989 * Saving the final RDB snapshot before exiting.
185:M 06 Feb 14:12:10.019 * DB saved on disk
185:M 06 Feb 14:12:10.019 # Redis is now ready to exit, bye bye...

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 17201 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'",
"su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one```

When I restarted it, I got a 502 error. I backed up the latest status with discourse backup after entering the app with ./launcher enter app.
Then tried to revert back to the last night’s backup with discourse restore $backupfile. It starts working but fails with some errors:

Restore Error Output
Starting restore: /var/discourse/shared/standalone/backups/default/pardus-forumlari-2019-02-06-023655-v20190130013015.tar.gz
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2019-02-06-135801 exists...
Copying archive to tmp directory...
EXCEPTION: /var/www/discourse/lib/backup_restore/local_backup_store.rb:43:in `download_file': Failed to copy archive to tmp directory.
cp: cannot stat '/var/www/discourse/public/backups/default/var/discourse/shared/standalone/backups/default/pardus-forumlari-2019-02-06-023655-v20190130013015.tar.gz': No such file or direct
/var/www/discourse/lib/discourse.rb:29:in `execute_command'
/var/www/discourse/lib/backup_restore/local_backup_store.rb:43:in `download_file'
/var/www/discourse/lib/backup_restore/restorer.rb:194:in `copy_archive_to_tmp_directory'
/var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
script/discourse:136:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
script/discourse:277:in `<top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:463:in `exec'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2019-02-06-135801' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Restore done.

The interesting part of this output is
cp: cannot stat '/var/www/discourse/public/backups/default/var/discourse/shared/standalone/backups/default/pardus-forumlari-2019-02-06-023655-v20190130013015.tar.gz': No such file or directory

The directory names are listed twice.
Is there a solution to:

  1. Restore the forum with its latest up and running state, without any restore.
  2. If (1) does not work, a way to restore the latest backup without any problems.

(Jay Pfaffman) #2

Did you do a standard install?

(Gökhan Gurbetoğlu) #3

I just renamed my old discourse folder (/var/discourse), created a new discourse folder and started a fresh install. After the installation I copied my latest backup into the new installation’s backup folder, then created a new user and I was able to enter the restore settings. I then restored my old backup from there and now the site is almost back to normal. Now my settings, custom data explorer queries and probably some other things I missed are lost and I do not know how to get them back.

(Jay Pfaffman) #4

All of those things should be in the backup of its up to date.

(Gökhan Gurbetoğlu) #5

Reverting to backup finally worked and almost everything is back to normal. Only a not-viewable Default theme has appeared (which can only be seen with hamburget theme selector plugin). I have lost some data due to this, so leaving the topic open if something seems wrong.

(Rafael dos Santos Silva) #6

Were the new and old install the same version? You can’t downgrade versions.

(Gökhan Gurbetoğlu) #7

They were the same version. I had just run an upgrade beforehand.