Skip to content
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

Question regarding error codes for distribution spec #554

Closed
git-hyagi opened this issue Sep 24, 2024 · 3 comments · Fixed by #555
Closed

Question regarding error codes for distribution spec #554

git-hyagi opened this issue Sep 24, 2024 · 3 comments · Fixed by #555

Comments

@git-hyagi
Copy link

Hi!

In the "Pushing Manifests" section, it mentions that the registry should respond with a code "413 Payload Too Large":

"A registry SHOULD enforce some limit on the maximum manifest size that it can accept. A registry that enforces this limit SHOULD respond to a request to push a manifest over this limit with a response code 413 Payload Too Large."

However, according to the definition in the 'Error Codes' section, the registry MUST follow one of the errors defined in the table, even though '413 Payload Too Large' is not included. This discrepancy seems to cause confusion and allows for different implementations, leading to a lack of standardization and conformance:
#260 (comment)

gcr.io [..] fails with UNKNOWN: Bad Request.
quay.io [..] fails with 413 Request Entity Too Large (an nginx error, not a spec error)
docker.io [..] MANIFEST_INVALID: manifest invalid; http: request body too large

Am I looking at the wrong place and "413 Payload Too Large" is a valid error?

@sudo-bmitch
Copy link
Contributor

#293 specified the status code without updating the endpoints table. That's easy enough to fix with a PR to the endpoints table to add the status code.

@sudo-bmitch
Copy link
Contributor

Also, the "Error codes" are part of the JSON body that a registry MAY return. The status codes are part of the HTTP headers included with every valid HTTP response. These two things are not the same.

The HTTP 413 status code is documented in the RFC: https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.11

@git-hyagi
Copy link
Author

Got it. Thank you for the explanations and the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants