# Problems after rollback database attempt

**URL:** <https://meta.discourse.org/t/problems-after-rollback-database-attempt/108500>\
**Category:** Self-hosting\
**Created:** [February 6, 2019, 2:14pm UTC](https://meta.discourse.org/t/problems-after-rollback-database-attempt/108500 "2019-02-06T14:14:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ggurbet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ggurbet/32/120188_2.png) [@ggurbet](https://meta.discourse.org/u/ggurbet)\
**Post date:** [February 6, 2019, 2:14pm UTC](https://meta.discourse.org/t/problems-after-rollback-database-attempt/108500/1 "2019-02-06T14:14:00Z")

</div>

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**
>
> ````plaintext
> ...
> /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 `&lt;top (required)&gt;'
> /usr/local/bin/bundle:23:in `load'
> /usr/local/bin/bundle:23:in `&lt;main&gt;'
> Tasks: TOP =&gt; assets:precompile
> (See full trace by running task with --trace)
> I, [2019-02-06T14:12:09.974132 #14] &#160;INFO -- : Purging temp files
> Bundling assets
> 
> I, [2019-02-06T14:12:09.976018 #14] &#160;INFO -- : Terminating async processes
> I, [2019-02-06T14:12:09.976263 #14] &#160;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...
> 
> FAILED
> --------------------
> Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake assets:precompile' failed with return #&lt;Process::Status: pid 17201 exit 1&gt;
> Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
> exec failed with the params {"cd"=&gt;"$home", "hook"=&gt;"bundle_exec", "cmd"=&gt;["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'"]}
> e2aa48ffcbcb1c7a4aa65b10ab13a03d2d8e0ab401ab9307bc5ea754f0634305
> **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**
>
> ```plaintext
> Starting restore: /var/discourse/shared/standalone/backups/default/pardus-forumlari-2019-02-06-023655-v20190130013015.tar.gz
> [STARTED]
> '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
> ory
> /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 `&lt;top (required)&gt;'
> /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 &lt;top (required)&gt;'
> /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 `&lt;top (required)&gt;'
> /usr/local/bin/bundle:23:in `load'
> /usr/local/bin/bundle:23:in `&lt;main&gt;'
> 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...
> Finished!
> [FAILED]
> 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.

---

_[View the full topic](https://meta.discourse.org/t/problems-after-rollback-database-attempt/108500)._
