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

Erratic Behaviour if Incorrect S3 Region Configured #2795

Closed
tustvold opened this issue Sep 28, 2022 · 1 comment · Fixed by #2796
Closed

Erratic Behaviour if Incorrect S3 Region Configured #2795

tustvold opened this issue Sep 28, 2022 · 1 comment · Fixed by #2796
Labels
bug object-store Object Store Interface

Comments

@tustvold
Copy link
Contributor

Describe the bug

S3 appears to have a somewhat perverse behaviour when a request is made to a bucket in the wrong region, specifically it returns a 301 redirect missing a LOCATION header. FWIW this appears to be in contravention of the HTTP specification - https://www.rfc-editor.org/rfc/rfc2616#section-10.3.2.

As this is missing a LOCATION header, it fails to trigger the redirect logic here which causes it to consider this a "valid" request. I'm not sure can be considered an upstream bug, as for its purposes it is unclear what the correct behaviour for redirects that aren't actually redirects is 😅.

reqwest::error_for_status_by_ref then treats this response as not an error. Normally failed redirects would result in an error higher up, but as this response lacks a LOCATION header, reqwest doesn't consider it a well-formed redirect

The result is that:

  • Requests with no response body will "succeed" - despite not doing anything
  • Requests with a response body will likely fail to parse correctly

To Reproduce

Configure an S3 integration test with the wrong region

Expected behavior

We should return an error clearly indicating what has gone wrong

Additional context

@alamb
Copy link
Contributor

alamb commented Sep 30, 2022

label_issue.py automatically added labels {'object-store'} from #2796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug object-store Object Store Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants