-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
service/s3: HeadObject documentsNoSuchKey
error code returned, but get NotFound
#1208
Comments
Thanks for contacting us @bsdlp. It looks like the service is modeling this error incorrectly modeling the In the meantime the S3 service will return a 404 ("NotFound") when the key does not exist, and 400 ("BadRequest") in other cases such as the bucket doesn't exist. |
NotFound
instead of NoSuchKey
NoSuchKey
error code returned, but get NotFound
The HeadObject's model incorrectly states that the operation can return the `NoSuchKey` error code. Fix aws#1208
The HeadObject's model incorrectly states that the operation can return the NoSuchKey error code. Fix #1208
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Summary: In the logs, we can see this 404 being translated into a 500: ``` 2018-05-23T00:21:51.866Z ERROR dockerregistry/blobs.go:79 Failed to download sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690: remote backend download: all origins unavailable: origin kraken-origin-master01-dca1:9003: GET http://kraken-origin-master01-dca1:9003/namespace/uber-usi%2Fmilton/blobs/sha256:d317746f2ef22a664bfc4df5303416b8b49443484bf44abe08c24812264c1690 500: stat: NotFound: Not Found ``` It turns out that the Go SDK is broken and HeadObject does not return ErrCodeNoSuchKey on 404s. See aws/aws-sdk-go#1208 Instead, we must check the string manually. Reviewers: #kraken, yiran Reviewed By: #kraken, yiran Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D1763887
Any update on this? |
#1220 claims to fix this issue but I don't see how. From what I can see there is no defined error for "NotFound" yet (do you mind if I at least add an ErrNotFound to service/s3/errors.go that can be checked?) |
@jasdel , |
I'm on 3d7575d.
The documentation claims that if a key is not found, an error with code
s3. ErrCodeNoSuchKey
is returned.s3. ErrCodeNoSuchKey
isNoSuchKey
whereas the actual error returned isNotFound
, which means my error check will not match. There is also no const forNotFound
.The text was updated successfully, but these errors were encountered: