# S3에 있는 이미지가 포함된 백업 복원 불가

**URL:** https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200
**Category:** Support
**Created:** [6월 9, 2022, 11:45오전 UTC](https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200 "2022-06-09T11:45:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [6월 9, 2022, 11:45오전 UTC](https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200/1 "2022-06-09T11:45:38Z")

</div>

> [@zogstrip](#):
>
> 이 작업들이 완료되고(업로드가 정상적으로 작동하면) 더 이상 백업에 업로드를 포함시킬 필요가 없습니다. 그리고 보너스로, 재앙적인 상황이 발생했을 때 [명령줄에서 백업을 복원](https://meta.discourse.org/t/restore-a-backup-from-command-line/108034)할 수 있게 됩니다(단, app.yml 사본을 어딘가에 보관해 두어야 합니다).

불행히도 이것이 작동하지 않습니다. 저는 전체 백업 10개를 가지고 있지만, 그중 어느 것도 복원할 수 없으며, 모두 동일한 오류를 보고 있습니다:

```plaintext
Reconnecting to the database...
Reloading site settings...
Disabling outgoing emails for non-staff users...
Disabling readonly mode...
Clearing category cache...
Reloading translations...
Remapping uploads...
Restoring uploads, this may take a while...
Migrating uploads to S3 for 'default'...
Uploading files to S3...
 - Listing local files
 => 5 files
 - Listing S3 files
.. => 1911 files
 - Syncing files to S3
.....
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
285 posts were flagged for a rebake
EXCEPTION: 509 of 1823 uploads are not migrated to S3. S3 migration failed for db 'default'.
/var/www/discourse/lib/file_store/to_s3_migration.rb:132:in `raise_or_log'
/var/www/discourse/lib/file_store/to_s3_migration.rb:79:in `migration_successful?'
/var/www/discourse/lib/file_store/to_s3_migration.rb:373:in `migrate_to_s3'
/var/www/discourse/lib/file_store/to_s3_migration.rb:66:in `migrate'
/var/www/discourse/lib/file_store/s3_store.rb:328:in `copy_from'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:62:in `restore_uploads'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:44:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:61:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:483:in `exec'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:31:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/cli.rb:25:in `start'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/exe/bundle:48:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.13/exe/bundle:36:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Trying to rollback...

```

왜 이런 일이 발생하는 걸까요? 많은 사람들이 이 문제를 보고했지만, 아직까지 제가 찾은 해결책은 없습니다. 백업과 복원은 매우 근본적인 필요 사항입니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [12월 7, 2022, 8:39오후 UTC](https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200/2 "2022-12-07T20:39:15Z")

</div>

(다른 주제의 답글을 정리해서 삭제하려고 합니다. 이 문제가 해결되었는지 명확하지 않아서 삭제하지 않았습니다.)

해결되셨나요?

이미지를 S3에 업로드하려고 하거나, 모든 이미지가 존재하는지 확인하는 과정에서 문제가 발생하는 것 같습니다.

복원 중 S3 업로드를 끄고, 나중에 다시 켜는 것이 해결책이라고 생각합니다.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [12월 8, 2022, 4:55오전 UTC](https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200/3 "2022-12-08T04:55:29Z")

</div>

네, 전체 해결책은 여기에 게시되었습니다

> [@복구 도움 요청 - 자정에 시스템이 멈춤](https://meta.discourse.org/t/help-restoring-system-hung-at-midnight/229486/):
>
> Okay this was bound to happen, things were just too good for too long. Years of running on cruise control, the system would automatically update itself and I would update Discourse every few weeks. At midnight last night, Amazon showed the system was unresponsive, discourse was down and the CPU was pegged at 100% until it ran out of AWS CPU resources. Couldn’t login to the system, the one time after several reboots I was able to login momentarily, I saw this in htoptaking up a lot of CPU snap l…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1월 7, 2023, 4:56오전 UTC](https://meta.discourse.org/t/cant-restore-backup-with-images-on-s3/248200/4 "2023-01-07T04:56:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
