即使键存在,S3也给我NoSuchKey错误 [英] S3 giving me NoSuchKey error even when the key exists

查看:1019
本文介绍了即使键存在,S3也给我NoSuchKey错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的boto3命令,用于从S3存储桶中获取具有特定键的对象:

This is my boto3 command for getting the object with a specific key from an S3 bucket:

resp = s3client.get_object(Bucket='<>-<>', Key='MzA1MjY1NzkzX2QudHh0')

它给出了以下错误:

botocore.errorfactory.NoSuchKey: An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.

我已经在存储桶中签入,并且密钥确实存在

I have checked in the bucket, and the key actually exists

我在这里错过了什么吗?还是我做错了什么?

推荐答案

URL末尾有%0A;那是一个行分隔符.

You have a %0A at the end of your URL; that's a line separator.

这篇关于即使键存在,S3也给我NoSuchKey错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆