-
Notifications
You must be signed in to change notification settings - Fork 443
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
S3 plugin does not correctly handle 307 redirects for newly created buckets #1760
Comments
The |
Legend! The redirect does now find the file, so we now get the correct data.
Here's the version I built:
And here's how I build it, in case I made a silly mistake somewhere:
|
Hmm, that shouldn't happen. I suspect the problem may be in |
I found a way to reproduce the problem on the public 1000genomes bucket. Hopefully #1762 will fix it. |
When you specify an S3 URL which does not include a region, you may receive from AWS either a 400 response with a body specifying where to retry, or - if the bucket is relatively new - a 307 response.
The HTSLib S3 plugin does not correctly follow the 307 redirects that AWS returns for newly created buckets.
Note that, in the logs below, rather than sending a HTTPS request to the specified location (https://samtools-reads-data.s3.eu-west-2.amazonaws.com/r.cram), it sends a HTTP request, leaving out the bucket name (http://s3.eu-west-2.amazonaws.com/r.cram), and so will always return a 404.
Logs below are from 1.18 on MacOS, but have also seen this in 1.19 on AmazonLinux.
From my experience, AWS will start sending 400 responses rather than 307s the day after the bucket was created, at which point the "samtools view" command works.
Documentation of the 307 redirect: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingRouting.html
The text was updated successfully, but these errors were encountered: