错误上传小文件使用s3cmd到S3?错误、上传、文件、s3cmd

2023-09-11 10:04:38 作者:友独少年

我有一个不寻常的错误:我的文件似乎太小,被上传到S3

I am having an unusual error: my files appear to be too small to be uploaded to s3!

我有没有上载一个小的日志文件:

I have a small log file which is not uploading:

s3cmd put log.txt s3://MY-BUCKET/MY-SUB-BUCKET/
ERROR: S3 error: Access Denied

但是,当我做到这一点:

But when I do this:

yes | head -n 10000000 >> log.txt
s3cmd put log.txt s3://MY-BUCKET/MY-SUB-BUCKET/
# this works for some reason.

幻数似乎是15MB,在该点s3cmd开始做多部分上传。

The magic number appears to be 15MB, the point at which s3cmd starts doing multipart uploads.

推荐答案

我正在运行到同样的问题,显然下面的政策需要显式地添加到IAM用户策略。对于一些奇怪的原因,这就需要对小文件,但没有大的文件进行设置。

I was running into this same issue and apparently the following policy needs to be explicitly added to the IAM users policy. For some odd reason this needs to be set for small files but not large files.

"s3:GetBucketLocation"

哇,这只是把3小时我的生活弄清楚。

Wow, that just took 3 hours of my life to figure out.