Backups failing, and admin page inaccessible

Since the most recent update, I’ve been getting error messages like this daily:

The backup has failed.

Here’s the log:

BackupRestore::BackupStore::StorageError
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:63:in `rescue in unsorted_files'
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:51:in `unsorted_files'
/var/www/discourse/lib/backup_restore/backup_store.rb:21:in `files'
/var/www/discourse/lib/backup_restore/backup_store.rb:26:in `latest_file'
/var/www/discourse/app/jobs/scheduled/schedule_backup.rb:11:in `execute'
/var/www/discourse/app/jobs/base.rb:137:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/app/jobs/base.rb:127:in `block in perform'
/var/www/discourse/app/jobs/base.rb:123:in `each'
/var/www/discourse/app/jobs/base.rb:123:in `perform'
/var/www/discourse/app/jobs/base.rb:185:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_scheduler-0.8.1/lib/mini_scheduler/manager.rb:81:in `process_queue'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_scheduler-0.8.1/lib/mini_scheduler/manager.rb:29:in `block in initialize'

And if I try to go to the admin/backups page, I get an unsmiley face and:

Error while trying to load [/admin/backups.json](https://[forum]/admin/backups.json)

If I go to that URL, I get - while logged in as admin - “Access Denied”

2 Likes

You probably enabled daily backups and the system tries to store them on Amazon S3, but gets an “Access Denied” error. First thing you could do is switching to local backup storage by going to /admin/site_settings/category/all_results?filter=backup%20location and changing the setting to “Local”.

If you want to store the backups on S3, please make sure that the S3 credentials are still valid. I recommend following the Configure automatic backups for Discourse guide.

And yes, I know, the error handling at /admin/backups could be improved. I’ll work on that…

5 Likes

Aha, thanks.

It turns out that the IAM policy was missing a couple of things that are now required. Working great now.

5 Likes

If you could list the things that need to be added to the IAM policy, It would be of great help. Thanks

2 Likes

I followed the guide linked above, the full IAM policy is in Setting up file and image uploads to S3 , which I’m linking to rather than pasting in as that’s likely to be updated in the future and this isn’t :smiley:

2 Likes

After updating today to these versions:

I’m now getting this error. My policy looks right from the guide and nothing else changed. Is there any more debugging I can do to track down what happened?

14

Something will show up in logs, can you have a look:

4 Likes

Thanks Sam, It was a pretty generic “Access Denied” error. I recreated the role per this post: Setting up file and image uploads to S3 and it started working again.

1 Like