I have an application which uploads images to an S3 bucket using Paperclip. It's been working fine for months, but suddenly my files are not being uploaded to the S3 bucket. Unfortunately, I've been doing a refactoring in a number of unrelated areas, and it's possible that something I changed broke my upload.
我有一个应用程序,它使用Paperclip将图像上传到S3桶中。它已经正常工作了几个月,但是突然之间我的文件没有被上传到S3桶中。不幸的是,我已经在一些不相关的领域进行了重构,我所做的一些改动可能会破坏我的上传。
I'm using paperclip 2.3.1.
我用回形针2.3.1。
That said, there are a number of confusing aspects to this and frankly I am at a loss. First, there are no errors in the log indicating that the upload failed. The paperclip attachment attributes are populated in the database. The application thinks the upload occurred successfully. But when I look in S3, the file is not there.
也就是说,这其中有很多令人困惑的方面,坦白地说,我很迷茫。首先,日志中没有显示上传失败的错误。在数据库中填充paperclip附件属性。应用程序认为上传成功。但是当我查看S3时,文件并不存在。
Second, I have an almost identical attachment on a different model, which uploads to the same S3 bucket successfully -- the code is almost identical, and there clearly cannot be a permissions issue.
其次,我在另一个模型上有一个几乎相同的附件,它成功地上传到了同一个S3桶中——代码几乎是相同的,显然不存在权限问题。
I found references in several places that suggested removing the right_aws game and instead only having the aws_s3 gem...which I did...but to no avail. Moreover, I never saw the (5 for 4) error in my log regardless.
我在几个地方找到了引用,建议删除right_aws的游戏,而只使用aws_s3 gem……我做了……但无济于事。而且,我从来没有在我的日志中看到(5代表4)的错误。
Does anyone have any suggestions on how I can further diagnose this? Are there any options in paperclip to increase the verbosity of logging?
有人对我如何进一步诊断有什么建议吗?在paperclip中是否有增加日志冗长性的选项?
Thanks!
谢谢!
2 个解决方案
#1
2
I had this issue as well and the cause was that my :multipart => true key/value hadn't been nested correctly in the :html key of the form_for helper.
我也遇到了这个问题,其原因是:multipart => true key/value没有正确地嵌套在form_for helper的:html键中。
#2
1
It turns out the app was using Paperclip 2.3.4 which introduced some S3 issues.
这款应用使用的是Paperclip 2.3.4,它引入了一些S3问题。
Upgrading to 2.3.5 solved the issue for me.
升级到2.3.5解决了我的问题。
#1
2
I had this issue as well and the cause was that my :multipart => true key/value hadn't been nested correctly in the :html key of the form_for helper.
我也遇到了这个问题,其原因是:multipart => true key/value没有正确地嵌套在form_for helper的:html键中。
#2
1
It turns out the app was using Paperclip 2.3.4 which introduced some S3 issues.
这款应用使用的是Paperclip 2.3.4,它引入了一些S3问题。
Upgrading to 2.3.5 solved the issue for me.
升级到2.3.5解决了我的问题。