-
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
When using the path-style request URL under the v2 protocol, list_objects_v2 does not work. #4433
Comments
Hi @feiniks , thanks for reporting this. Although https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html
However I am able to repro the issue and getting this error while using
while it succeeds with This might be due to how the signature is calculated with V2 protocol but not really sure - https://github.com/boto/botocore/blob/3ff30ef929da20bc83a1f21d1bd3ab6e408648fe/botocore/auth.py#L95 It would be helpful if you could mention what region you are using, just to make sure if this is not among the regions , which are not supported by V2, hence leading to the error. |
Hello @Khushai, |
Hi @feiniks , thanks for sharing the required information. |
@feiniks , as shared earlier s3v2 is legacy and would not work across APIs so its suggested to use the latest protocol s3v4 which is current standard supported version and should be used. s3v2 is used for presigned URLs in specific cases for backwards compatibility only. Hence we won't be able to take much action on this issue and don't recommend using this at all. Hope that clarifies your ask. let me know if you have any other questions. Thanks. |
Describe the bug
When performing the list_objects_v2 operation using the s3v2 protocol with a path-style request URL, objects cannot be listed, and an exception is thrown:
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the ListObjectsV2 operation: None
. However, it works normally when using a virtual host or s3v4.Regression Issue
Expected Behavior
When performing the list_objects_v2 operation using the s3v2 protocol with a path-style request URL, objects can be listed.
Current Behavior
The objects cannot be listed, and an exception is thrown:
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the ListObjectsV2 operation: None
Reproduction Steps
Possible Solution
The issue might be that the authPath is not handled correctly during authentication under the v2 protocol. I tried modifying the
canonical_string
method in theHmacV1Auth
class of botocore/auth.py. If it's a path-style request, omitting authPath allows it to work correctly.Additional Information/Context
No response
SDK version used
boto3 1.36.13
Environment details (OS name and version, etc.)
ubuntu 18.04
The text was updated successfully, but these errors were encountered: