`aws s3 ls `适用于本地机器,但是在EC2 NoSuchBucket错误

时间:2022-06-24 10:46:26

When I use the command aws s3 ls on both my EC2 machine and local Macbook, the output is the same, it lists all the buckets in S3. aws configure has the exact same ID, secret key, region, output format.

当我在EC2机器和本地Macbook上使用命令aws s3 ls时,输出相同,它列出了S3中的所有桶。 aws configure具有完全相同的ID,密钥,区域,输出格式。

However, when I actually go to look at the contents of a bucket using the command aws s3 ls <bucket-name>, my local machine correctly lists all the items, while my EC2 responds with:

但是,当我实际使用命令aws s3 ls 查看存储桶的内容时,我的本地计算机正确列出了所有项目,而我的EC2响应:

A client error (NoSuchBucket) occurred when calling the ListObjects operation: The specified bucket does not exist.

调用ListObjects操作时发生客户端错误(NoSuchBucket):指定的存储桶不存在。

The EC2 machine can clearly communicate with the account correctly, but why would it not be able to list bucket contents when my local machine can? I don't see any permissions that would let my machine access it when the EC2 can't.

EC2机器可以清楚地与帐户正确通信,但为​​什么当我的本地机器可以时无法列出存储桶内容?当EC2无法访问时,我没有看到任何允许我的机器访问它的权限。

1 个解决方案

#1


1  

This isn't a complete answer but a workaround. The output of when using --debug like helloV suggested showed that the command was using the bucket name with the first 5 characters removed. When I added 5 random characters to the front of the bucket name (like .....bucket-name as opposed to bucket-name) it works and properly lists the content. If anyone has any clue as to why this is I would like to know.

这不是一个完整的答案,而是一个解决方法。使用--debug(如helloV)建议时的输出显示该命令使用的桶名称已删除前5个字符。当我在桶名称的前面添加5个随机字符(比如...... bucket-name而不是bucket-name)时,它可以正常列出内容。如果有人知道为什么这是我想知道的。

#1


1  

This isn't a complete answer but a workaround. The output of when using --debug like helloV suggested showed that the command was using the bucket name with the first 5 characters removed. When I added 5 random characters to the front of the bucket name (like .....bucket-name as opposed to bucket-name) it works and properly lists the content. If anyone has any clue as to why this is I would like to know.

这不是一个完整的答案,而是一个解决方法。使用--debug(如helloV)建议时的输出显示该命令使用的桶名称已删除前5个字符。当我在桶名称的前面添加5个随机字符(比如...... bucket-name而不是bucket-name)时,它可以正常列出内容。如果有人知道为什么这是我想知道的。