Comments (2)
Thanks for reaching out - this has come up a few times before, I'll share the recent comment that I made here on a related issue to provide more context:
...Related issues have come up here a few times before, for example boto/boto3#2499. Both the HeadObject and HeadBucket APIs return 404 errors if the object or bucket does not exist. And as noted in the documentation:
A
HEAD
request has the same options as aGET
operation on an object. The response is identical to theGET
response except that there is no response body. Because of this, if theHEAD
request generates an error, it returns a generic code, such as400 Bad Request
,403 Forbidden
,404 Not Found
,405 Method Not Allowed
,412 Precondition Failed
, or304 Not Modified
. It's not possible to retrieve the exact exception of these error codes.So this is the behavior of the underlying S3 API and therefore not something that will be addressed in Boto3. As mentioned in previous issues it would be a breaking change to update the model. But please use the Provide feedback at the bottom of API documentation pages to send any additional feedback directly to the S3 team.
from botocore.
I've been digging a bit further and finally figured out why botocore
is unable to handle these cases for HEAD request.
I was initially under the impression that based on the current schema, it is possible for botocore
to "recover" the error code from the HTTP status code given that all HTTP status codes can be mapped unambiguously to error codes (per endpoint). Unfortunately, this is not the case. Although there are only 3(!) HEAD
requests in the whole API and 2 of them are HeadObject
and HeadBucket
which has a single error code specified, but Media Store's DescribeObject
has 2 error cases1 which result in HTTP 404 status codes (in addition to a bunch of common 400 errors), so my assumption is proven wrong.
Footnotes
from botocore.
Related Issues (20)
- botocore still ignore "HTTP/1.1 100" HOT 2
- botocore/botocore/data/ssm-incidents/2018-05-10 /waiters-2.json = Formatted Differently than other waiters-2.json Files HOT 5
- WAFV2 PutLoggingConfiguration raising AccessDeniedException without naming required permissions HOT 2
- Occasional segfaults when using Client from multiple threads HOT 6
- start_live_tail raising an error when executed in a Lambda - Header not supported – X-Amzn-Trace-Id HOT 5
- sqs create_queue does not return `QueueUrl` since v1.34.90 HOT 5
- `boto3.client('wellarchitected').get_profile_template()` raises RuntimeError HOT 4
- Performance issue due to SSLContext being recreated over and over HOT 1
- OSError: [Errno 24] Too many open files causes CredentialRetrievalError HOT 3
- Add support for fast fail when token bucket empty
- The request signature we calculated does not match the signature you provided: Check your AWS Secret Access Key and signing method HOT 2
- RecursionError through botocore/endpoint_provider.py:572 HOT 3
- Support environment variable for S3 addressing_style config HOT 3
- Add GlobalSign Root R6 to cacert.pem HOT 2
- Waiter documentation about error behavior is incorrect HOT 1
- Retry on `IllegalLocationConstraintException` HOT 2
- Stubber.add_response for query method validate against an invalid schema HOT 3
- datetime.datetime.utcnow() is deprecated as of Python 3.12 HOT 2
- Memory leak tests use substantially more memory on Python 3.13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botocore.