Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-1002

Helm 3 OCI Support Push Fails due to invalid MIME type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • quay-v3.4.0
    • None
    • quay

      Attempted to push Helm 3 chart using Quay latest upstream image 

       

      Set the following configuration values:

      FEATURE_GENERAL_OCI_SUPPORT: true
      FEATURE_EXPERIMENTAL_HELM_OCI_SUPPORT: true
      

      During the push, the following error is produced

       

      gunicorn-registry stdout | 2020-08-25 16:56:15,351 [317] [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/oci/manifest.py", line 141, in __init__
      gunicorn-registry stdout |     validate_schema(self._parsed, OCIManifest.METASCHEMA)
      gunicorn-registry stdout |   File "/usr/local/lib/python3.6/site-packages/jsonschema/validators.py", line 934, in validate
      gunicorn-registry stdout |     raise error
      gunicorn-registry stdout | jsonschema.exceptions.ValidationError: 'application/tar+gzip' is not one of ['application/vnd.oci.image.layer.v1.tar', 'application/vnd.oci.image.layer.v1.tar+gzip', 'application/vnd.oci.image.layer.nondistributable.v1.tar', 'application/vnd.oci.image.layer.nondistributable.v1.tar+gzip']
      gunicorn-registry stdout | Failed validating 'enum' in schema['properties']['layers']['items']['properties']['mediaType']:
      gunicorn-registry stdout |     {'description': 'The MIME type of the referenced manifest',
      gunicorn-registry stdout |      'enum': ['application/vnd.oci.image.layer.v1.tar',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.v1.tar+gzip',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.nondistributable.v1.tar',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.nondistributable.v1.tar+gzip'],
      gunicorn-registry stdout |      'type': 'string'}
      gunicorn-registry stdout | On instance['layers'][0]['mediaType']:
      gunicorn-registry stdout |     'application/tar+gzip'
      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 275, 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 OCIManifest(manifest_bytes)
      gunicorn-registry stdout |   File "/quay-registry/image/oci/manifest.py", line 143, in __init__
      gunicorn-registry stdout |     raise MalformedOCIManifest("manifest data does not match schema: %s" % ve)
      gunicorn-registry stdout | image.oci.manifest.MalformedOCIManifest: manifest data does not match schema: 'application/tar+gzip' is not one of ['application/vnd.oci.image.layer.v1.tar', 'application/vnd.oci.image.layer.v1.tar+gzip', 'application/vnd.oci.image.layer.nondistributable.v1.tar', 'application/vnd.oci.image.layer.nondistributable.v1.tar+gzip']
      gunicorn-registry stdout | Failed validating 'enum' in schema['properties']['layers']['items']['properties']['mediaType']:
      gunicorn-registry stdout |     {'description': 'The MIME type of the referenced manifest',
      gunicorn-registry stdout |      'enum': ['application/vnd.oci.image.layer.v1.tar',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.v1.tar+gzip',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.nondistributable.v1.tar',
      gunicorn-registry stdout |               'application/vnd.oci.image.layer.nondistributable.v1.tar+gzip'],
      gunicorn-registry stdout |      'type': 'string'}
      gunicorn-registry stdout | On instance['layers'][0]['mediaType']:
      gunicorn-registry stdout |     'application/tar+gzip'
      

      Appears to be due to how the OCIManifest.METASCHEMA is referenced -in https://github.com/quay/quay/blob/master/image/oci/manifest.py#L120

       

      The  ADDITIONAL_LAYER_CONTENT_TYPES which is appended to when the check for the helm feature is executed. However, the issue is since the METASCHEMA variable is constructed beforehand, it is unaware that it has been updated here -> https://github.com/quay/quay/blob/master/image/oci/manifest.py#L120
       

              tomckay@redhat.com Thomas Mckay (Inactive)
              ablock@redhat.com Andrew Block
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: