上传迁移至 S3 失败

Can you pls elaborate what you did here (you showed double inverted commas here).
And what’s the relevance of this edit? I mean, how did you know that this was the culprit or how did it solve this?

I’m facing with this error while migrating my images/assets from local to S3: “S3 migration failed for db ‘default’” (my branding logos don’t show anywhere).

1 个赞
> FileStore::ToS3MigrationError: 部分上传文件无法迁移到新方案。您需要手动修复此问题。
> /var/www/discourse/lib/file_store/to_s3_migration.rb:151:in `migrate_to_s3'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:61:in `migrate'
> /var/www/discourse/lib/tasks/uploads.rake:239:in `migrate_to_s3'
> /var/www/discourse/lib/tasks/uploads.rake:218:in `block in migrate_to_s3_all_sites'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:64:in `with_connection'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:74:in `each_connection'
> /var/www/discourse/lib/tasks/uploads.rake:216:in `migrate_to_s3_all_sites'
> /var/www/discourse/lib/tasks/uploads.rake:212:in `block in <top (required)>'


通常,我拥有这些文件。除了 original 文件夹外,所有文件应该都齐全——但该文件夹中没有图片。
为什么会这样?也许最好直接手动复制(Ctrl + C)就解决了?

assets 文件夹:

1 个赞

我尝试修改它,但它不再位于 lib/tasks/uploads.rake 中了。那么可能是什么问题呢?

1 个赞

请明确说明这一行应该放在哪里,以及等号后面的双引号是否需要原样保留(即留空),还是说我们应该在引号内填入自己的 S3 CDN 地址?请给予指导。

1 个赞

已在命令行执行了 export 指令:
export DISCOURSE_S3_CDN_URL=""

这样 Linux 就能将其识别为系统变量。即使我不使用 CDN,也必须用空引号来设置该变量。

2 个赞

上述代码行已不再存在于 lib/tasks/upload.rake 文件中。
我已非常仔细地搜索了整个(上述提到的)文件。

感谢回复,但你指的是哪个命令行?这条命令是否需要在 web_only 容器内执行?

1 个赞

它们可能从那以后已经更新了,那是两年前的事了。

我指的是你的 Linux 服务器。我“进入”了容器(sudo ./launcher enter app),并导出了环境变量,以便系统知晓它们的值。希望这能帮到你。

3 个赞