0

我对 aws-cli 有问题,我进行了 yum 更新,它更新了 awscli(除其他外),现在 awscli 在带有 SignatureDoesNotMatch 的大文件(例如 5.1 Gb)上失败。具有较小文件的完全相同的命令(对同一个存储桶)有效。如果我使用 python 中的 boto,大文件仍然有效。

它复制了除了两个看起来像的所有部分(即,它被计数到 745 个部分中的 743 个),然后出现错误消息。

看起来像 awscli 中的错误?不过,当我四处搜索时,我找不到任何关于它的信息。

这一切都在 ec2 实例上执行。

$ /usr/bin/aws --version
aws-cli/1.5.4 Python/2.6.9 Linux/3.14.20-20.44.amzn1.x86_64

$ ls -hl
-rw-rw-r-- 1 user user      4 Nov  4 21:14 small
-rw-rw-r-- 1 user user 5.1G Nov  4 20:02 big

$ /usr/bin/aws s3 cp small s3://mybucket/uploaded.ext
upload: ./small to s3://mybucket/uploaded.ext

$ /usr/bin/aws s3 cp big s3://mybucket/uploaded.ext
upload failed: ./big to s3://mybucket/uploaded.ext
A client error (SignatureDoesNotMatch) occurred when calling the UploadPart operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.

编辑:以为我找到了,但仍然有这个问题。我宁愿坚持使用 awscli,因为它是我们在整个代码中使用的,而且它比 boto 快得多(至少在它工作时)

Edit2:它实际上变得越来越糟,我可以在控制台中重复相同的复制命令,有时它会通过,有时它不会

4

2 回答 2

1

aws-cli当然可以处理 5GB 及更高的上传。

我启动了一个 EC2 实例并能够成功完成它:

$ /usr/bin/aws --version
aws-cli/1.3.6 Python/2.6.9 Linux/3.10.35-43.137.amzn1.x86_64

$ dd if=/dev/zero of=small bs=1K count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000388469 s, 2.6 MB/s

$ dd if=/dev/zero of=big bs=5M count=1000
1000+0 records in
1000+0 records out
5242880000 bytes (5.2 GB) copied, 73.733 s, 71.1 MB/s

$ aws s3 mb s3://target77
make_bucket: s3://target77/

$ aws s3 cp small s3://target77/small
upload: ./small to s3://target77/small

$ aws s3 cp big s3://target77/big
upload: ./big to s3://target77/big       

$ aws s3 ls s3://target77/
2014-11-17 09:44:42 5242880000 big
2014-11-17 09:44:29       1024 small

到现在为止还挺好!

然后我更新到 CLI 的较新版本并再次尝试:

$ sudo yum update
...

$ /usr/bin/aws --version
aws-cli/1.5.5 Python/2.6.9 Linux/3.10.35-43.137.amzn1.x86_64

$ aws s3 cp small s3://target77/small
upload: ./small to s3://target77/small

$ aws s3 cp big s3://target77/big
upload failed: ./big to s3://target77/bigs) remaining
A client error (SignatureDoesNotMatch) occurred when calling the UploadPart operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.

我用 EC2 实例和 S3 存储桶在同一区域和不同区域重复了实验。这两种情况最终都给出了错误,但有时也有效。

因此,更新后的 aws-cli 似乎确实存在问题。另外,当我尝试重新执行复制命令时,错误发生在随机数量的“部分”之后。

SignatureDoesNotMatch错误与安全凭证有关,而不是与 Amazon S3 服务有关。这听起来类似于人们在 GitHub 上报告的问题:Recurring SignatureDoesNotMatch client error #995

因此,我建议使用早期版本的 aws-cli,直到问题得到解决。

于 2014-11-17T10:18:40.037 回答
0

如果这是 aws-cli 中的错误,我不会感到惊讶。我建议使用s3cmd而不是将文件复制到 S3 或从 S3 复制文件并执行所有其他基于 S3 的交互。

于 2014-11-05T00:35:16.020 回答