# S3 迁移错误，涉及 oneboxed 帖子

**URL:** https://meta.discourse.org/t/s3-migration-error-with-oneboxed-posts/167621
**Category:** Support
**Created:** [2020年十月19日 14:47 UTC](https://meta.discourse.org/t/s3-migration-error-with-oneboxed-posts/167621 "2020-10-19T14:47:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simonk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simonk/32/247950_2.png) [@simonk](https://meta.discourse.org/u/simonk)
#### Post date: [2020年十月19日 14:47 UTC](https://meta.discourse.org/t/s3-migration-error-with-oneboxed-posts/167621/1 "2020-10-19T14:47:32Z")

</div>

大家好，

我正尝试使用 `rake uploads:migrate_to_s3` 命令将本地上传存储迁移到 S3。目前该命令在 `migration_successful?` 检查阶段失败，报错如下：

```plaintext
1 posts are not remapped to new S3 upload URL. S3 migration failed for db 'default'

```

> <https://github.com/discourse/discourse/blob/v2.6.0.beta4/lib/file_store/to_s3_migration.rb#L85>

我的站点未使用 CDN，因此脚本中相关部分仅查找 `cooked` 内容中包含 `/uploads/default/original` 的帖子。

我修改了脚本以显示失败的帖子，结果发现该帖子包含指向另一个 Discourse 论坛的 onebox。其生成的 HTML 中包含指向该论坛 logo 的链接。由于另一个论坛也未使用 CDN，其 logo URL 中包含了上述字符串。

看来该测试需要进一步收紧，以确保仅匹配本地引用。或许需要将其拆分为两个测试：一个针对包含站点名称的绝对 URL，另一个针对相对引用？

提前感谢任何建议。
