Schema Manifest fails validation
Issue
While copying an image during a mirror we get a schema validation error in the quay logs:
gunicorn-registry stdout | 2023-05-25 12:45:28,504 [294] [INFO] [gunicorn.access] 172.x.x.x - - [25/May/2023:12:45:28 +0000] "PUT /v2/testing/mongo-mirror/blobs/uploads/07971eb1-7f6a-469a-9d9f-c9d031e4883e?digest=sha256%3A1f3f56933a5142a19e79cb7daca88866208331d2cc0cb54258e302a54d958689 HTTP/1.1" 201 0 "-" "skopeo/1.9.4-dev"
nginx stdout | 172.x.x.x (-) - - [25/May/2023:12:45:28 +0000] "HEAD /v2/testing/mongo-mirror/blobs/sha256:282fd552add6aa67509775e68e32aeabb2ea88726299367d49e36847c65833b4 HTTP/1.1" 404 0 "-" "skopeo/1.9.4-dev" (0.008 1255 0.004)
gunicorn-registry stdout | 2023-05-25 12:45:28,662 [295] [INFO] [gunicorn.access] 172.x.x.x - - [25/May/2023:12:45:28 +0000] "HEAD /v2/testing/mongo-mirror/blobs/sha256:282fd552add6aa67509775e68e32aeabb2ea88726299367d49e36847c65833b4 HTTP/1.1" 404 0 "-" "skopeo/1.9.4-dev"
nginx stdout | 172.x.x.x (-) - - [25/May/2023:12:45:28 +0000] "POST /v2/testing/mongo-mirror/blobs/uploads/ HTTP/1.1" 202 0 "-" "skopeo/1.9.4-dev" (0.011 1234 0.016)
gunicorn-registry stdout | 2023-05-25 12:45:28,678 [295] [INFO] [gunicorn.access] 172.17.0.1 - - [25/May/2023:12:45:28 +0000] "POST /v2/testing/mongo-mirror/blobs/uploads/ HTTP/1.1" 202 0 "-" "skopeo/1.9.4-dev"
gunicorn-registry stdout | 2023-05-25 12:45:28,707 [295] [INFO] [gunicorn.access] 172.17.0.1 - - [25/May/2023:12:45:28 +0000] "PATCH /v2/testing/mongo-mirror/blobs/uploads/4378123d-8402-4f90-8082-812747ee40be HTTP/1.1" 202 0 "-" "skopeo/1.9.4-dev"
nginx stdout | 172.x.x.x (-) - - [25/May/2023:12:45:28 +0000] "PATCH /v2/testing/mongo-mirror/blobs/uploads/4378123d-8402-4f90-8082-812747ee40be HTTP/1.1" 202 0 "-" "skopeo/1.9.4-dev" (0.023 7428 0.024)
nginx stdout | 172.17.0.1 (-) - - [25/May/2023:12:45:28 +0000] "PUT /v2/testing/mongo-mirror/blobs/uploads/4378123d-8402-4f90-8082-812747ee40be?digest=sha256%3A282fd552add6aa67509775e68e32aeabb2ea88726299367d49e36847c65833b4 HTTP/1.1" 201 0 "-" "skopeo/1.9.4-dev" (0.030 1390 0.028)
gunicorn-registry stdout | 2023-05-25 12:45:28,743 [295] [INFO] [gunicorn.access] 172.x.x.x - - [25/May/2023:12:45:28 +0000] "PUT /v2/testing/mongo-mirror/blobs/uploads/4378123d-8402-4f90-8082-812747ee40be?digest=sha256%3A282fd552add6aa67509775e68e32aeabb2ea88726299367d49e36847c65833b4 HTTP/1.1" 201 0 "-" "skopeo/1.9.4-dev"
gunicorn-registry stdout | 2023-05-25 12:45:28,752 [295] [ERROR] [endpoints.v2.manifest] failed to parse manifest when writing by tagname
gunicorn-registry stdout | Traceback (most recent call last):
gunicorn-registry stdout | File "/quay-registry/image/docker/schema2/manifest.py", line 161, in __init__
gunicorn-registry stdout | validate_schema(self._parsed, DockerSchema2Manifest.METASCHEMA)
gunicorn-registry stdout | File "/usr/local/lib/python3.9/site-packages/jsonschema/validators.py", line 934, in validate
gunicorn-registry stdout | raise error
gunicorn-registry stdout | jsonschema.exceptions.ValidationError: 'application/octet-stream' is not one of ['application/vnd.docker.container.image.v1+json']
gunicorn-registry stdout | Failed validating 'enum' in schema['properties']['config']['properties']['mediaType']:
gunicorn-registry stdout | {'description': 'The MIME type of the referenced object. This should '
gunicorn-registry stdout | 'generally be '
gunicorn-registry stdout | 'application/vnd.docker.container.image.v1+json',
gunicorn-registry stdout | 'enum': ['application/vnd.docker.container.image.v1+json'],
gunicorn-registry stdout | 'type': 'string'}
gunicorn-registry stdout | On instance['config']['mediaType']:
gunicorn-registry stdout | 'application/octet-stream'
gunicorn-registry stdout | During handling of the above exception, another exception occurred:
gunicorn-registry stdout | Traceback (most recent call last):
gunicorn-registry stdout | File "/quay-registry/endpoints/v2/manifest.py", line 317, in _parse_manifest
gunicorn-registry stdout | return parse_manifest_from_bytes(Bytes.for_string_or_unicode(request_data), content_type)
gunicorn-registry stdout | File "/quay-registry/image/shared/schemas.py", line 38, in parse_manifest_from_bytes
gunicorn-registry stdout | return DockerSchema2Manifest(manifest_bytes)
gunicorn-registry stdout | File "/quay-registry/image/docker/schema2/manifest.py", line 163, in __init__
gunicorn-registry stdout | raise MalformedSchema2Manifest("manifest data does not match schema: %s" % ve)
gunicorn-registry stdout | image.docker.schema2.manifest.MalformedSchema2Manifest: manifest data does not match schema: 'application/octet-stream' is not one of ['application/vnd.docker.container.image.v1+json']
gunicorn-registry stdout | Failed validating 'enum' in schema['properties']['config']['properties']['mediaType']:
gunicorn-registry stdout | {'description': 'The MIME type of the referenced object. This should '
gunicorn-registry stdout | 'generally be '
gunicorn-registry stdout | 'application/vnd.docker.container.image.v1+json',
gunicorn-registry stdout | 'enum': ['application/vnd.docker.container.image.v1+json'],
gunicorn-registry stdout | 'type': 'string'}
gunicorn-registry stdout | On instance['config']['mediaType']:
gunicorn-registry stdout | 'application/octet-stream'
gunicorn-registry stdout | 2023-05-25 12:45:28,754 [295] [INFO] [gunicorn.access] 172.17.0.1 - - [25/May/2023:12:45:28 +0000] "PUT /v2/testing/mongo-mirror/manifests/3.2.7 HTTP/1.1" 400 683 "-" "skopeo/1.9.4-dev"
nginx stdout | 172.17.0.1 (-) - - [25/May/2023:12:45:28 +0000] "PUT /v2/testing/mongo-mirror/manifests/3.2.7 HTTP/1.1" 400 683 "-" "skopeo/1.9.4-dev" (0.005 3482 0.008)
Environment
quay 3.8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.