If we get a QuotaExceededError back from the storage driver when doing a write
for either manifests or blobs, return a DENIED to the client with the message
"quota exceeded".
Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
Add a new storagedriver error to be used when quotas are exceeded, and return it
from the S3 driver.
Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
The S3 implementation of `Writer` creates a multipart upload and then uploads to
it as data is written. Previously errors were returned verbatim, but in order to
handle things like quotas we should parse the S3 errors so we can return more
meaningful errors to callers of `Write`.
Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
Completing a blob upload is a multi-step process, especially on a storage
backend like S3 which lacks a "move" primitive. If a client times out (or
disconnects) during a commit, then retries immediately, we'll end up invoking
the "resume" logic for the blob upload while the completion from the previous
request is still in progress. The resume tries to find the upload's data, but
the commit has already moved it to its new location, resulting in a PathNotFound
error from the storage driver.
Previously, this error was passed back to the HTTP handler and translated into a
500 Internal Server Error. Return ErrBlobUploadUnknown instead, so that the HTTP
handler will return a 404.
Using the linked blob store for blob requests fixes a conformance issue and
works correctly for newly-pushed images. However, any images that were pushed
before the change could be missing layer links (since previously it was possible
to fetch a blob without the layer link existing) and it's not possible to pull
these iamges after the change.
Revert the change to use the linked blob store, for now, until we can figure out
how to fix this without breaking existing repositories.
This reverts commit 71f1c25220.
Adds "Completed" handler for S3 requests that logs critical HTTP request/response fields necessary to understand problems between registry and underlying S3 api.
Signed-off-by: Wayne Warren <wayne.warren.s@gmail.com>