Skip to content

pushing same artifact after garbage-collection GET/ manifest #3800

Closed

Description

@anibmurthy

Pull of image/artifact fails if same artifact was garbage-collected earlier.

registry - v2.8.1
GKE cluster

From the logs I see that, there is an error in garbage-collect call while deleting one of the blobs. And the second push of the artifact does not include blobs which might be causing the subsequent pull call to fail. Same steps without garbage-collect has no issues.

Steps to reproduce:

  • Push hello-new artifact
HEAD url: /v2/dev-nse/hello-new/blobs/sha256:73210d5a3c15b283379f89be996123bcc2ae0af4be7ca8c59c7f918106aae10d
HEAD url: /v2/dev-nse/hello-new/blobs/sha256:2d90ee9db78fa72022a6f90fd710ccabcca55ce46499557428c1bb2ad8113f43
POST url: /v2/dev-nse/hello-new/blobs/uploads/
POST url: /v2/dev-nse/hello-new/blobs/uploads/
PATCH url: /v2/dev-nse/hello-new/blobs/uploads/41e39cc3-c590-4595-9fbb-d27129848da9
PATCH url: /v2/dev-nse/hello-new/blobs/uploads/b9c21589-fb43-4f0c-ab34-dc4ae0dca5db
PUT url: /v2/dev-nse/hello-new/blobs/uploads/41e39cc3-c590-4595-9fbb-d27129848da9
PUT url: /v2/dev-nse/hello-new/blobs/uploads/b9c21589-fb43-4f0c-ab34-dc4ae0dca5db
PUT url: /v2/dev-nse/hello-new/manifests/sha256-922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0.imgpkg
  • Pull
$ curl https://source-registry/v2/dev-nse/hello-new/manifests/sha256:922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0
{"schemaVersion":2,"mediaType":"application/vnd.docker.distribution.manifest.v2+json","config":{"mediaType":"application/vnd.docker.container.image.v1+json","size":273,"digest":"sha256:73210d5a3c15b283379f89be996123bcc2ae0af4be7ca8c59c7f918106aae10d"},"layers":[{"mediaType":"application/vnd.docker.image.rootfs.diff.tar.gzip","size":199407,"digest":"sha256:2d90ee9db78fa72022a6f90fd710ccabcca55ce46499557428c1bb2ad8113f43"}]}
  • Delete manifest
│ 127.0.0.1 - - [23/Nov/2022:17:39:42 +0000] "DELETE /v2/dev-nse/hello-new/manifests/sha256:922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0 HTTP/2.0" 202 0 "" "Go │
│ [Info] dev-nse/hello-new
  • registry garbage-collect --delete-untagged /etc/docker/registry/config.yml
0 blobs marked, 3 blobs and 0 manifests eligible for deletion                                                                                                                     │
│ blob eligible for deletion: sha256:2d90ee9db78fa72022a6f90fd710ccabcca55ce46499557428c1bb2ad8113f43                                                                               │
│ blob eligible for deletion: sha256:73210d5a3c15b283379f89be996123bcc2ae0af4be7ca8c59c7f918106aae10d                                                                               │
│ blob eligible for deletion: sha256:922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0                                                                               │
│ [Error] time="2022-11-23T17:11:37.908881181Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/2d/2d90ee9db78fa72022a6f90fd710ccabcca55ce46499557428c1bb2ad8113f43 │
│ time="2022-11-23T17:11:37.909150781Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/73/73210d5a3c15b283379f89be996123bcc2ae0af4be7ca8c59c7f918106aae10d" go.ver │
│ time="2022-11-23T17:11:37.909369601Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/92/922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0" go.ver │
│
  • Push the same artifact
HEAD url: /v2/dev-nse/hello-new/blobs/sha256:2d90ee9db78fa72022a6f90fd710ccabcca55ce46499557428c1bb2ad8113f43
HEAD url: /v2/dev-nse/hello-new/blobs/sha256:73210d5a3c15b283379f89be996123bcc2ae0af4be7ca8c59c7f918106aae10d
PUT url: /v2/dev-nse/hello-new/manifests/sha256-922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0.imgpkg
  • Pull returns an error
$ curl https://source-registry/v2/dev-nse/hello-new/manifests/sha256:922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0
{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown","detail":{"Name":"dev-nse/hello-new","Revision":"sha256:922d1ced648f7010caca476349b7406bc2379a210f7c82bf100125d9e13d41c0"}}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions