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

Audit errors raised during manifes/manifest list push #625

Open
Tracked by #1134
ipanova opened this issue Mar 10, 2022 · 1 comment
Open
Tracked by #1134

Audit errors raised during manifes/manifest list push #625

ipanova opened this issue Mar 10, 2022 · 1 comment
Labels

Comments

@ipanova
Copy link
Member

ipanova commented Mar 10, 2022

Compare our behavior to dockerhub and update where necessary https://github.com/distribution/distribution/blob/d80a63f1eaa215246eee566f4426d2f2ceecc06e/registry/api/v2/errors.go

HTTP/1.1 400 Bad Request
content-length: 237
content-type: application/json
date: Thu, 10 Mar 2022 13:45:35 GMT
docker-distribution-api-version: registry/2.0
docker-ratelimit-source: 86.49.250.169
strict-transport-security: max-age=31536000

{
    "errors": [
        {
            "code": "MANIFEST_INVALID",
            "detail": "mediaType in manifest list should be 'application/vnd.docker.distribution.manifest.list.v2+json' not 'application/vnd.docker.distribution.manifest.v2+json'",
            "message": "manifest invalid"
        }
    ]
}




HTTP/1.1 400 Bad Request
content-length: 625
content-type: application/json
date: Thu, 10 Mar 2022 13:46:32 GMT
docker-distribution-api-version: registry/2.0
docker-ratelimit-source: 86.49.250.169
strict-transport-security: max-age=31536000

{
    "errors": [
        {
            "code": "MANIFEST_BLOB_UNKNOWN",
            "detail": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7",
            "message": "blob unknown to registry"
        },
        {
            "code": "MANIFEST_BLOB_UNKNOWN",
            "detail": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
            "message": "blob unknown to registry"
        },
        {
            "code": "MANIFEST_BLOB_UNKNOWN",
            "detail": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b",
            "message": "blob unknown to registry"
        },
        {
            "code": "MANIFEST_BLOB_UNKNOWN",
            "detail": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736",
            "message": "blob unknown to registry"
        }
    ]
}


@lubosmj
Copy link
Member

lubosmj commented Dec 6, 2022

Almost all of the errors (error codes specifically) are compliant with the definitions in the specs. Error messages can be left untouched. The classes BlobInvalid and BlobNotFound should be unified on our side because they are used for the same use case.

The error INVALID_REQUEST should not be used when dealing with invalid ranges within partial_update. We should start returning an HTTP 416 error.

Besides that, we will need to re-consider if it is worth adding other types of errors to our implementation, like SIZE_INVALID, TAG_INVALID, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Not Started
Development

No branches or pull requests

2 participants