aio-libs / aiobotocore

asyncio support for botocore library using aiohttp

Home Page:https://aiobotocore.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

leminhnguyen opened this issue · comments

Dear authors and contributors
I've built a lambda function (python 3.7) on AWS and used aiobotocore=2.5.0 for downloading objects asynchronously from S3. Everything worked well in recent months but today after updating the function (just updating my own code, not the libraries) I encountered the error: botocore.errorfactory.NoSuchBucket: An error occurred (NoSuchBucket) when calling the GetObject operation: The specified bucket does not exist (although the bucket exists)
The code snippet:

sess = aiobotocore.get_session()
conf = AioConfig(max_pool_connections=10)
async with sess.create_client(
    service_name="s3", config=conf, **get_credentials()
) as s3_client:
    content = await s3_client.get_object(
        Bucket="bucket", Key="abc.zip"
    )
    content = await content["Body"].read()

I also tried to use the raw boto3 library and it's working well, so I guess the AWS just updated something and the problem come with aiobotocore, so any suggestions to fix this? Thanks in advance