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

Pushing an artifact to Quay with oras binary results in a 502

XMLWordPrintable

    • False
    • None
    • False
    • Quay Enterprise

      Copying the following artifact from an outside source to Quay results in a 502 being raised:

      root@cyberdyne:~/oras# ./oras cp  ghcr.io/devcontainers/features/docker-outside-of-docker:1.2.1 quay.skynet/ibazulic/docker-outside-of-docker:1.2.1
      Exists  18451468e5ee devcontainer-feature-docker-outside-of-docker.tgz
      Error: PUT "https://quay.skynet/v2/ibazulic/docker-outside-of-docker/blobs/uploads/d270c27e-4435-4202-970d-5fb6adeb7802?digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": response status code 502: Bad Gateway
      

      The error is caused by the following exception:

      gunicorn-registry stdout | 2023-05-11 20:02:44,534 [245] [ERROR] [data.registry_model.blobuploader] Exception when uploading blob `d270c27e-4435-4202-970d-5fb6adeb7802`
      gunicorn-registry stdout | Traceback (most recent call last):
      gunicorn-registry stdout |   File "/quay-registry/data/registry_model/blobuploader.py", line 108, in complete_when_uploaded
      gunicorn-registry stdout |     yield blob_upload
      gunicorn-registry stdout |   File "/quay-registry/endpoints/v2/blob.py", line 411, in monolithic_upload_or_last_chunk
      gunicorn-registry stdout |     _upload_chunk(uploader, digest)
      gunicorn-registry stdout |   File "/quay-registry/endpoints/v2/blob.py", line 545, in _upload_chunk
      gunicorn-registry stdout |     return blob_uploader.commit_to_blob(app.config, commit_digest)
      gunicorn-registry stdout |   File "/quay-registry/data/registry_model/blobuploader.py", line 303, in commit_to_blob
      gunicorn-registry stdout |     storage_already_existed = self._finalize_blob_storage(app_config)
      gunicorn-registry stdout |   File "/quay-registry/data/registry_model/blobuploader.py", line 363, in _finalize_blob_storage
      gunicorn-registry stdout |     self.storage.complete_chunked_upload(
      gunicorn-registry stdout |   File "/quay-registry/storage/distributedstorage.py", line 27, in wrapper
      gunicorn-registry stdout |     return storage_func(*args, **kwargs)
      gunicorn-registry stdout |   File "/quay-registry/storage/cloud.py", line 977, in complete_chunked_upload
      gunicorn-registry stdout |     self._client_side_chunk_join(final_path, chunk_list)
      gunicorn-registry stdout |   File "/quay-registry/storage/cloud.py", line 573, in _client_side_chunk_join
      gunicorn-registry stdout |     concatenated = filelike.FilelikeStreamConcat(self._chunk_generator(chunk_list))
      gunicorn-registry stdout |   File "/quay-registry/util/registry/filelike.py", line 97, in __init__
      gunicorn-registry stdout |     self._current_file = next(file_generator)
      gunicorn-registry stdout | StopIteration
      ...
      nginx stdout | 2023/05/11 20:02:44 [error] 103#0: *150 upstream prematurely closed connection while reading response header from upstream, client: 172.24.10.50, server: _, request: "PUT /v2/ibazulic/docker-outside-of-docker/blobs/uploads/d270c27e-4435-4202-970d-5fb6adeb7802?digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 HTTP/2.0", upstream: "http://unix:/tmp/gunicorn_registry.sock:/v2/ibazulic/docker-outside-of-docker/blobs/uploads/d270c27e-4435-4202-970d-5fb6adeb7802?digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", host: "quay.skynet"
      

      To push this image to Quay the following OCI artifacts need to be set in Quay's config.yaml file:

      ALLOWED_OCI_ARTIFACT_TYPES: 
        application/vnd.devcontainers: 
        - application/vnd.devcontainers.layer.v1+tar
      

      The same issue does not happen if the upstream registry is proxied through Quay. If the artifact is pulled through a proxied organization, it will be successfully stored in Quay without raising any errors. This only happens on normal pushes.

      Please check! Thanks!

              marckok Marcus Kok
              rhn-support-ibazulic Ivan Bazulic
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: