Skip to content
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

fix(region cache): x-amz-bucket-region can be missing for s3 compatible #929

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shcheklein
Copy link
Contributor

In some cases x-amz-bucket-region. E.g. Yandex S3 returns these headers:

'server' = 'nginx'
'date' = 'Sat, 11 Jan 2025 18:24:12 GMT'
'content-type' = 'application/xml'
'connection' = 'keep-alive'
'keep-alive' = 'timeout=60'
'x-amz-request-id' = '427d58f44ef55822'

We do have a logic to disable region caching if custom endpoint of region are specified:

       for parameters in (config_kwargs, self.kwargs, init_kwargs, client_kwargs):
            for option in ("region_name", "endpoint_url"):
                if parameters.get(option):
                    self.cache_regions = False
                    break
        else:
            cache_regions = self.cache_regions

But it won't work if endpoint is specified via env var, or S3 config file (or some other complicated or even dynamic logic that boto is relying internally?). If someone has an idea how to get an efficient value for the endpoint URL - let me know.

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.

1 participant