-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
s3api head-object
does not return proper error for unknown key
#666
Comments
The same useless error happens when the user does not have access to the key in question:
|
This is fixed now in the latest version of the CLI (looks like we forgot to link the fix with this issue):
The issue here is that this is a HEAD request, which does not contain a response body. In these scenarios we just use the status code message as the error message as shown above. |
usually in my case what was happening was there was an extra slash in the front of the key which was causing this issue. Fixing the key name helped overcome this issue |
This may not be an issue of
aws-cli
per se, but rather an issue of s3 api in general.When you execute
s3api head-object
for unknown key,aws
command just returnsclient error (Unknown)
, which makes it difficult to track down the problem.s3 server returns
404
http status forHEAD
, but response body is empty.For comparison,
s3api get-object-acl
returnsA client error (NoSuchKey)
for such case and error message is included in xml formatted response body..Demonstration(removing unrelated parts)
The text was updated successfully, but these errors were encountered: