S3 head_object fails if called directly after instanciating a client #4334
Labels
bug
This issue is a confirmed bug.
closed-for-staleness
p3
This is a minor priority issue
response-requested
Waiting on additional information or feedback.
s3
Describe the bug
boto3.client
fails with400 - Bad Request
.get_object
,list_objects
etc.) works.Expected Behavior
Calling boto3's head_object just after instantiating a
boto3.client
should works, returns HTTP 200 & the related object's metadata.Current Behavior
botocore.exceptions.ClientError
is raised (see reproduction steps)Reproduction Steps
Run a Python 3.12 bare image
Once inside the image:
Here I can retry
s3_client.head_object()
as many time as I want: it will always fail with400 - Bad Request
.Now, restart the process from the point where we start Python, and do a
get_object
(or any other call likelist_objects
) before callinghead_object
:head_object
will works.Possible Solution
head_object
works directly after instantiating theclient
only ifregion_name
was given in the client's paramsAdditional Information/Context
No response
SDK version used
1.35.51,1.35.54
Environment details (OS name and version, etc.)
Debian 12
The text was updated successfully, but these errors were encountered: