Backup failed message doesn't mention specific error

AI-generated summary

A user, Dannii, reported receiving a generic “backup failed” message with a stack trace, but without the specific error. To find the actual error, they had to manually check the backups tab and click on a link to /admin/backups.json, which revealed the issue: “The AWS Access Key Id you provided does not exist in our records.” Dannii suggested including this error in the initial message. Additionally, they mentioned not receiving notifications for the backup failure, despite not muting the admin group. gerhard addressed both issues, creating pull requests to include the original error message (#12257) and fix the notification bug (#12255).

I got an admin message saying that the backup had failed, but it only had a stack trace:

Message

The backup has failed.

Here’s the log:

BackupRestore::BackupStore::StorageError
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:84:in `rescue in unsorted_files'
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:72:in `unsorted_files'
/var/www/discourse/lib/backup_restore/backup_store.rb:23:in `files'
/var/www/discourse/lib/backup_restore/backup_store.rb:28:in `latest_file'
/var/www/discourse/app/jobs/scheduled/schedule_backup.rb:12:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-2.5.0/lib/rails_multisite/connection_management.rb:76:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
/var/www/discourse/app/jobs/base.rb:279:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/mini_scheduler-0.13.0/lib/mini_scheduler/manager.rb:93:in `process_queue'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/mini_scheduler-0.13.0/lib/mini_scheduler/manager.rb:37:in `block (2 levels) in initialize'

Only when I went to the backups tab and clicked on the link to /admin/backups.json did I see the problem:

{"errors":["The AWS Access Key Id you provided does not exist in our records."]}

It would be good if this was included in the message as well.

(Also, I didn’t get any notifications for this message - it’s been sending one a day for ages! Any ideas why? I can’t see where I could’ve muted the admin group.)

2 Likes

Any ideas if this can be improved @gerhard ?

2 Likes

Thanks for reporting those issues. I made a small adjustment to include the original error message.

https://github.com/discourse/discourse/pull/12257

This was caused by a bug.

https://github.com/discourse/discourse/pull/12255

3 Likes