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
private registry delete manifest results in broken state #1755
Comments
|
hi @yofreke this is not the expected behavior. When a manifest is removed, any tags which reference it are also removed. If you have a minimal reproduction case could paste the file layout of your registry? |
|
The registry we are using has >100gb worth of data. I can do some investigating if there are specifics you are looking for? |
|
+1 Seeing the exact same problem with registry:2.4.1 (ID b0bfd772479f4e19f5546daf8c2a0c9673e699006de30d1f5b1623ee6d8d27f8) with a fairly big amount of images (~550GB). Probably will have to ignore this error for now in my cleanup script so that our registry won't run out of HDD |
|
@yofreke : i'm curious to see the repository layout, specifically the tags and manifests. Otherwise, if you can post the registry logs with the most verbose setting that would help too. |
|
I am observing the same issue, and I believe that the same steps lead me to it. But I cannot find any clue except that directories for tags still contain |
|
The delete command removes the link file of the manifest and then the tags which are referencing that manifest. If you inspect the storage backend for the repository in question and can still see tags contain the manifest then there is a bug. If you do see this, please post your registry version, logs from the delete operation and if possible the repository keys in the back-end. Without this information, debugging will be very difficult. |
|
+1 Having the same issue with same commands. Registry version 2.4.1 |
|
FYI does not provide the right tag digest for v2 deletion. You have to use a additional header as mentionned in the offical docs: https://docs.docker.com/registry/spec/api/#/deleting-an-image Proceeding this way fixed the issue for me. |
|
This was happening to me, too. Initially tried to delete with registry:2.4.1 and some of the tags were stuck. Upgrade to registry:2.5.1 seems to have fixed it for me. |
|
Sounds like this is fixed in 2.5.1. Closing. If anyone is still having issues, please let me know. |
|
We're experiencing this bug in Registry v2.6.1. returns 4 tags, when fetching manifests of tag 8.17 as #1755 (comment) said, it failed: docker logs of registry as below: How can I delete this tag now? |
|
Got the same problem in v.2.6.2. Running the garbage collector will also not free diskspace ... not good! |
|
@stevvooe |
|
@hinshun Could you please take a peak at this issue? |
|
Hi all, thanks for reporting the issue. Unfortunately I was unable to reproduce the issue. I made a minimal Configuration: My steps: If you are still experiencing problems, please open a new issue and provide your configuration and steps to reproduce the issue. It's likely there are differences between my minimal setup and specific configurations that triggering the bug. |
|
i also use registry 2.6.2 and following @hinshun 's solution, it works for me. |
|
Same thing happens to me registry version -> registry github.com/docker/distribution v2.6.2 docker version -> Docker version 18.03.1-ce, build 9ee9f40 using -> -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' |
|
Same thing happens to me! |
|
@hinshun @imendi @ooxiaohan The behavior reported by @hinshun is expected. When a manifest is deleted then all the tags that refer to it are also deleted. In his/her case the manifest referred to tag @Davidrjx When you do |
|
@manishtomar problem with GET .../list/... - I have same thing. |
|
I can confirm that we are also seeing the same issue with our private registry (version 2.7.1) and using the proper headers, etc. Note that this doesn't happen on every image deletion. Most deletes are successful and remove the manifest/tag together but some get "stuck" in this state. One workaround solution that we have found is to push another "dummy" image to the "stuck" tag and then retry the deletion. This has worked so far, but I'm unsure if the blobs from the old tag are actually deleted on the storage or have become orphaned by this "workaround". |
|
@a1kemist |
|
Please tell me if I should open a new issue "Tag manifest unknown after deletion, and growing disk usage". I have a similar situation on version 2.6.2, some deleted tags are still listed but they raise I redacted the registry and repository names: On the server, some files remain in What can be done on the filesystem to remove some tags without corrupting the filesystem?
|
|
@jcarsique, what's the result of those requests if you omit the |
|
@jcarsique I see that when I accidentally deleted a single platform manifest from a multi platform manifest list. You can pull the digest for the manifest list with the proper accept header, and then delete that digest to clean things up. |
|
@joaodrp same result without headers: |
|
@sudo-bmitch what do you mean? My issue is that no digest is returned but manifest unknown, with this accept header: |
|
@jcarsique the header for a docker manifest list is Same image, three different manifests depending on the header, and the manifest list is the real one, the registry is looking up the default platform for the v2 manifest, and automatically converting that to a v1 schema without any header. Those manifests have different digests: Deleting the digest for a single platform leaves things in a semi-broken state: But you can still get the manifest list digest and remove that to clean things up: |
|
@sudo-bmitch It's crystal clear, thank you. I'll take care to use the proper digest for deletion, when using the API (I'm now mostly using the Should I simply remove those two directories? I don't know if it's related or another issue but there's also a lot of revisions not referenced by a tag. |
|
@jcarsique There's also the OCI media types. It's a bit self promoting, but regclient's regctl is what I use for this, lot of similar functionality to Double check that the digest you deleted matches what you're seeing in those repos, e.g. Once the manifest is removed for me, the tag is gone immediately without any GC. The GC is needed to remove some of the underlying blobs. I don't know enough of the filesystem storage of registry to be able to advise what's safe to remove. |
|
@sudo-bmitch by the way, I also found this cleanup.sh script that works on the local filesystem. It tends to give information on the file structure. At the end, upgrading from 2.6 to 2.7 allowed to use the new |
Saw some similar issues, but didnt find anything for this particular problem.
docker registry version:
registry:2Digest: sha256:bf9b4a7b53a2f54c7b4d839103ca5be05b6a770ee0ba9c43e9ef23d602414f44I am using a private registry backed by S3, using basic auth.
Steps:
do:
curl https://<regsitry>/v2/manager/tags/listobserve:
{"name":"manager","tags":[...,"1.3.0","1.3.1","latest"]}I want to delete tag
1.3.1get tag digest
do:
curl https://<registry>/v2/manager/manifests/1.3.1 -vobserve:
< Docker-Content-Digest: sha256:4cd37f5633ac95dc32ceca3359a109f2c5a20517f2ded9eace4e12dccf58835adelete tag
do:
curl -X DELETE https://<registry>/v2/manager/manifests/sha256:4cd37f5633ac95dc32ceca3359a109f2c5a20517f2ded9eace4e12dccf58835a -vobserve:
< HTTP/1.1 202 Acceptedensure tag is gone
do:
curl https://<regsitry>/v2/manager/tags/listobserve:
{"name":"manager","tags":[...,"1.3.0","1.3.1","latest"]}server logs:
do: question life and the meaning of happiness,
curl https://<registry>/v2/manager/manifests/1.3.1 -vobserve:
{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown","detail":{"Name":"manager","Revision":"sha256:4cd37f5633ac95dc32ceca3359a109f2c5a20517f2ded9eace4e12dccf58835a"}}]}server logs:
Questions:
How do I actually remove this tag?
The text was updated successfully, but these errors were encountered: