如果通过GUI上传到S3,则BOTO3 API不会返回列表中的新文件

发布于 2025-02-13 02:59:12 字数 388 浏览 1 评论 0原文

我在Python上有一组BOTO3驱动的命令。他们似乎很棒,可以从S3下载文件。

bucket = s3_client.Bucket(bucket_name)
for obj in bucket.objects.filter(Prefix=key_dir):
    # Iterate over all files to download

问题是,我现在已经测试了通过GUI手动上传文件到同一存储桶和前缀区域。.我可以看到文件列出,它的大小为非零置...所有这些都从GUI上载好了..但是,

当我重复上面的API调用...所有相同的旧文件都会回来了。但是我的全新文件从列表中省略了..

我需要破坏缓存或其他内容吗?默认情况下,AWS Boto3库似乎只看到长期的文件。

I have a set of boto3 powered commands in python. they seem to be working great to download files from S3.

bucket = s3_client.Bucket(bucket_name)
for obj in bucket.objects.filter(Prefix=key_dir):
    # Iterate over all files to download

The trouble is, I've now tested uploading a file manually via the GUI to this same bucket and prefix area.. I can see the file is listing, it is of a non-zero size... all uploaded well from the GUI.. BUT

When I repeat the API calls like above... all the same older files come back just fine.. but my brand new file is omitted from the list..

Do I need to bust a cache or something? Seems the AWS Boto3 library by default is only seeing long lived files..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘心安 2025-02-20 02:59:13

这种行为似乎与2018年制造的水桶孤立。因此,我计划忽略它并创建一个新的水桶。.一旦我有了一个新的水桶,这种行为完全停止了..奇怪的是,希望它可以帮助其他可能看到这一点的人

The behavior seems isolated to a bucket made in 2018.. so I plan to just ignore this and create a new bucket.. once I had a new bucket this behavior stopped altogether.. strange, but hope it helps others who might see this

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文