# 无法下载备份

**URL:** https://meta.discourse.org/t/unable-to-download-backups/254065
**Category:** Bug
**Created:** [2023 年2 月 4 日 17:44 UTC](https://meta.discourse.org/t/unable-to-download-backups/254065 "2023-02-04T17:44:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [2023 年2 月 4 日 17:44 UTC](https://meta.discourse.org/t/unable-to-download-backups/254065/1 "2023-02-04T17:44:05Z")

</div>

我无法下载我的 Discourse 的任何备份。

我的备份会自动存储在 AWS S3 存储桶中。文件确实存在，并且可以通过 AWS 控制台浏览到 S3 存储桶手动下载。

我正在运行 v3.1.0.beta2 ([e64d1c4105](https://github.com/discourse/discourse/commits/e64d1c4105f5342b1e2b6aa5c3d073538619b306))

重现步骤（我的浏览器是 macOS Ventura 13.2 上的 Safari 16.3）：

1. 转到 管理员 \> 备份
2. 点击下载按钮
3. 到达后点击电子邮件中的链接

应该发生什么？

- 备份应该下载

实际发生什么？

- 浏览器窗口中出现错误：

> [@](#):
>
> # 糟糕
> 
> 此讨论论坛的软件遇到了意外问题。很抱歉给您带来不便。
> 
> 有关错误的详细信息已记录，并生成了自动通知。我们会对其进行检查。
> 
> 无需进一步操作。但是，如果错误情况持续存在，您可以通过在网站的反馈类别中发布讨论主题来提供更多详细信息，包括重现错误的步骤。

Discourse 错误日志显示了一个致命错误：

> ActionController::Redirecting::UnsafeRedirectError (不安全的重定向到“https://[REDACTED].s3.eu-west-2.amazonaws.com/default/[REDACTED]-2023-02-04…”，传递 allow\_other\_host: true 以便重定向)：

还有：

```plaintext
ActionController::Redirecting::UnsafeRedirectError (不安全的重定向到“https://[REDACTED].s3.eu-west-2.amazonaws.com/default/[REDACTED]-2023-02-04...”，传递 allow_other_host: true 以便重定向)：

app/controllers/admin/backups_controller.rb:87:in `show'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

回溯

actionpack (7.0.4.1) lib/action_controller/metal/redirecting.rb:193:in `_enforce_open_redirect_protection'
actionpack (7.0.4.1) lib/action_controller/metal/redirecting.rb:89:in `redirect_to'
actionpack (7.0.4.1) lib/action_controller/metal/flash.rb:62:in `redirect_to'
actionpack (7.0.4.1) lib/action_controller/metal/instrumentation.rb:42:in `block in redirect_to'
activesupport (7.0.4.1) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.4.1) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.0.4.1) lib/action_controller/metal/instrumentation.rb:41:in `redirect_to'
app/controllers/admin/backups_controller.rb:87:in `show'
actionpack (7.0.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'

环境

HTTP HOSTS: greyarro.ws
```

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [2023 年2 月 5 日 20:35 UTC](https://meta.discourse.org/t/unable-to-download-backups/254065/2 "2023-02-05T20:35:14Z")

</div>

这是一个修复程序：

> <https://github.com/discourse/discourse/pull/20171>
>
> Follow-up to 008b700a3f24fdbb0feb9897321b61a3deabe0e2

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [2023 年2 月 5 日 20:53 UTC](https://meta.discourse.org/t/unable-to-download-backups/254065/4 "2023-02-05T20:53:15Z")

</div>

太棒了！感谢修复（以及修复的速度！）🙇‍♂️:t2:

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [2023 年3 月 23 日 11:29 UTC](https://meta.discourse.org/t/unable-to-download-backups/254065/8 "2023-03-23T11:29:38Z")

</div>


