-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClientError without 'Error' key #4046
Comments
Just adding the cloudwatch logs: |
Thanks for reaching out and for your patience in hearing back here. Can you please provide the full Boto3 logs (with any sensitive info redacted) by adding |
Hi Tim, 2024-05-05 21:16:03,180 - root - ERROR - Error while creating temporary copy: I hope this can help |
Thanks @zalex5 for following up and sharing that info. What we need to investigate this issue further is the actual XML response returned from the S3 API, to determine if this is an issue with the underlying API or the parsing done on the SDK side. So for example given this script, import boto3
# Create an S3 client
s3 = boto3.client('s3')
boto3.set_stream_logger('')
# Set the source and destination bucket and object names
source_bucket_name = 'source-bucket'
source_object_name = 'test.txt'
dest_bucket_name = 'dest-bucket'
dest_object_name = 'dest-test.txt'
# Create the copy source dictionary
copy_source = {
'Bucket': source_bucket_name,
'Key': source_object_name
}
# Copy the object
s3.copy(copy_source, dest_bucket_name, dest_object_name)
print(f'Successfully copied {source_object_name} from {source_bucket_name} to {dest_bucket_name}/{dest_object_name}') And then this
|
Hi @tim-finnigan, We are also in contact with AWS relative to this issue: If they provide the necessary resources to offset the debugging costs, I will update this ticket with the requested information. Thank you very much for your help! |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
You can close the issue since AWS took charge of its resolution. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Hi,
we have an issue with S3 boto3 client apis call.
Sometimes our code generates a KeyError while parsing ClientError exceptions and the missing key is 'Error'.
The code is:
In cloudwatch we see this failing with the following message:
Just to let you know, this issue is not easily replicable: it happened 20 times in the last four weeks (considering thousands/millions of calls).
We know we can bypass the error testing for the presence of the 'Error' key in the 'response' dictionary but we couldn't find any documents mentioning that the ClientError could miss that key.
Any information about this situation would be much appreciated,
Thank you
Expected Behavior
We expect to be able to access the 'Error' key every time a ClientError is raised.
Current Behavior
Sometimes the ClientError object has no 'Error' key inside the 'response' dictionary.
Reproduction Steps
The code is very basic
and also this (very similar):
Possible Solution
No response
Additional Information/Context
Both the functions are executed in a lambda triggered by EventBridge (configured to react to a storage class transition).
SDK version used
The AWS lambda default for Python 3.9 runtime
Environment details (OS name and version, etc.)
Lambda runtime Python 3.9
The text was updated successfully, but these errors were encountered: