Skip to content

Fix AWS Access#18

Open
ksemchh wants to merge 2 commits into
stactools-packages:mainfrom
ksemchh:main
Open

Fix AWS Access#18
ksemchh wants to merge 2 commits into
stactools-packages:mainfrom
ksemchh:main

Conversation

@ksemchh

@ksemchh ksemchh commented May 28, 2025

Copy link
Copy Markdown

Description:
When connecting to public S3-buckets via boto3, an access error occurred:

botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

To solve this problem it was necessary to add the parameter signature_version=UNSIGNED when creating the S3 client, which disables request signing, allowing access to public buckets without AWS keys.

Сode changes:
In the S3 client initialization place (utils.py), Config and UNSIGNED are imported from botocore.

In the client constructor client(‘s3’, ...) the argument config=Config(signature_version=UNSIGNED) is passed.

PR checklist:

  • Code is formatted (run scripts/format).
  • Code lints properly (run scripts/lint).
  • Tests pass (run scripts/test).
  • Documentation has been updated to reflect changes, if applicable.
  • Changes are added to the CHANGELOG.

@gadomski

Copy link
Copy Markdown
Contributor

Can you use AWS_REQUEST_PAYER="requester" in your environment, instead?

@ksemchh

ksemchh commented May 29, 2025

Copy link
Copy Markdown
Author

Environment variable didn't work for me. The access error is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants