Wiederherstellung fehlgeschlagen bei "EXCEPTION: x von y Uploads wurden nicht nach S3 migriert. S3-Migration fehlgeschlagen für db 'default'."

This has been sitting as a draft on meta.discourse.org as I worked through the issue on my Discourse server. I’ve been able to get around the problem described below, but that I couldn’t do what was effectively a disaster restore (a restore without the benefit of being able to get into the old, broken server) is concerning. (The root cause was a failed Postgres 10-to-12 upgrade, but I was able to postpone the update in the Discourse app.yml file long enough to disable the enable_s3_uploads site setting before creating the backup. I’ve now done that backup, uploaded it to the new server, restored it, and have the Discourse site running again. Original message:


I am reconstructing a Discourse install from backup stored on S3. The old installation was very old—first installed in June 2016. I started the restore from a fresh installation because of a failed Postgres 10-to-12 upgrade. Rather than fix that…since this box was running an no longer supported version of Ubuntu…I thought I would just take the latest backup and load it onto the new server. The restore fails, however. In the logs, the point at which I’m running into a problem is here:

[2020-11-23 22:27:32] Reloading translations...
[2020-11-23 22:27:32] Remapping uploads...
[2020-11-23 22:27:32] Restoring uploads, this may take a while...
[2020-11-23 22:28:38] EXCEPTION: 465 of 751 uploads are not migrated to S3. S3 migration failed for db 'default'.
[2020-11-23 22:28:38] /var/www/discourse/lib/file_store/to_s3_migration.rb:131:in `raise_or_log'
/var/www/discourse/lib/file_store/to_s3_migration.rb:78:in `migration_successful?'
/var/www/discourse/lib/file_store/to_s3_migration.rb:357:in `migrate_to_s3'
/var/www/discourse/lib/file_store/to_s3_migration.rb:65:in `migrate'
/var/www/discourse/lib/file_store/s3_store.rb:238:in `copy_from'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:48:in `restore_uploads'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:30:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:64:in `run'
/var/www/discourse/script/spawn_backup_restore.rb:23:in `restore'
/var/www/discourse/script/spawn_backup_restore.rb:36:in `block in <main>'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `fork'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `<main>'
[2020-11-23 22:28:38] Trying to rollback...

This sounds similar to Restore process cancelled at migrating uploads to S3 step - #5 by Jim.Morrison, but it didn’t offer any guidance on how to fix the issue.

The before-you-post message in the right pane of this compose window also suggested Failed to restore DB, but that didn’t have anything helpful either.

1 „Gefällt mir“

Ich habe hier das gleiche Problem, konnte es aber noch nicht lösen:

Könnten Sie genauer erklären, was Sie hier genau gemacht haben? Wurden diese Einstellungen auf der Admin-Seite → Einstellungen-GUI deaktiviert oder in der app.yml? Konnten Sie es also nach dem Backup wiederherstellen und alles zurückbekommen? Haben Sie diese Einstellung nach dem Backup wieder aktiviert? Danke

Dies wurde beim Bearbeiten der Datei app.yml vorgenommen, und ja, ich konnte alles wiederherstellen. Leider habe ich vor 2 Jahren keine Notizen von meiner Arbeit erstellt, und die Details sind im Laufe der Zeit verloren gegangen. Ich habe „Uploads in Backup einschließen“ nicht wieder aktiviert, aber ich denke, ich werde es jetzt tun – hoffentlich ist das Problem, das ich zuvor hatte, behoben.

1 „Gefällt mir“

Haben Sie nach der Wiederherstellung defekte Links zu Anhängen in den Beiträgen gefunden?

Soweit ich mich erinnern kann nicht. Viel Glück!