You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In 2.5.1 garbage-collection stops when running into failed to garbage collect: failed to mark: invalid checksum digest format #1960
I guess this is more of a question than a bug, since I assume the issue lies with my environment, but:
Trying to run garbage-collection, it stops with:
failed to garbage collect: failed to mark: invalid checksum digest format
Then switched to --dry-run to see where it happens, but can't spot anything wrong at the last blob that was marked. Is the offending blob or whatever it is the previous one listed or the next one that hasn't been logged yet. Any ideas on how to fix it? Should I just delete the manifest or blob and leave the repo in a broken state somehow ?
Reacted by Edward Xie , Christian Nadeau, Evgeny, Johannes Edmeier, Dylan Wang, Gogeof, Dimitri KOPRIWA, Alexandre Buisine, Hoang Pham, Kiran Pawar and 6 more
What is the last line printed in your dry run? My best guess is that there is a manifest which is not being parsed correctly. The 'marking manifest x' message should indicate which it is.
So does this imply the last blob is somehow broken? What would be the least damaging way to fix it? ( I assume that removal of things is the only way to fix these ) Remove the manifest with the offending party?
Hello, went digging in, there is an empty link file under
reponame/_manifests/revisions/sha256/437c175248b6014b7a257783333e8a3e44aa7b3a1838af02747c18ddb5d3a2dd/signatures/sha256/285fcc9d2080173304921fc55fd52793a9cf643575ae3372be0c51fae6ffac0a/link
( that manifest being the last manifest to be mentioned in the log )
Looked at a couple others and they had content in them.
Hmm, I will try to rerun GC with debug logs on once I get back to work after paternal leave. ( Just explaining the delay in replies, I'm sure you are not holding your breath waiting anyway =) )
I ended up rebuilding the registry I am maintaining and haven't bumped into this one with the new one yet. I was using an S3 implementation via s3fs,( filesystem storagedriver) I went with the assumption that it was an issue in that. What storage method are you running on?
I've removed the empty links and the gc eventually ran. Didn't find the answer to this yet. I increased the storage size of my registry and never run the gc again.
Hi,
That's finally what I did too. I identified & removed all empty links files and the garbage collect process looks complete.
Problem is that garbage collect looks not removing all useless data ... Is there a way to force it to remove all useless data ?
Thanks
Reacted by Pavel Alexeev aka Pahan-Hubbitus, kcd83, zhujian and pada57
So does this imply the last blob is somehow broken? What would be the least damaging way to fix it? ( I assume that removal of things is the only way to fix these ) Remove the manifest with the offending party?
thanks 👍 I also deleted the folder ,then retry the GC, it works
[root@dharbor registry]# docker run -it --name gc --rm -v /opt/registry/data/registry:/var/lib/registry -v /opt/registry/conf/registry:/etc/docker/registry/config.yml registry:2.6.2 garbage-collect /etc/docker/registry/config.yml
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused "rootfs_linux.go:58: mounting \"/opt/registry/conf/registry\" to rootfs \"/var/lib/docker/overlay2/9ea840a3bac96908d677cb9ef0cf4d963ad04c34583f8b5d147fd4b4a861dd33/merged\" at \"/var/lib/docker/overlay2/9ea840a3bac96908d677cb9ef0cf4d963ad04c34583f8b5d147fd4b4a861dd33/merged/etc/docker/registry/config.yml\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled
On Thu, Nov 26, 2020, 10:32 PM FlorinAlexandru ***@***.***> wrote:
Hello @RichardScothern <https://github.com/RichardScothern>
here is the last section of the dry-run logs:
reponame: marking manifest
sha256:437c175248b6014b7a257783333e8a3e44aa7b3a1838af02747c18ddb5d3a2dd
reponame: marking blob
sha256:63cf8e9782dd9ff96aade2076b5cd510eb131f6c24987af8b7191b8bb8a47d52
reponame: marking blob
sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob
sha256:31f838803b2beddabfbdf7fa62c4773ca611c78c3157dbccc6331e19f2289130
reponame: marking blob
sha256:400b2f4fbd6a3edc11da4d16c5994668b6c3e5b510331f396b561858811959a5
reponame: marking blob
sha256:dc1037d25537c058a775a28f0ff793383fce3c1873dba055c26a0b0e02fabeea
reponame: marking blob
sha256:6b5a47d7a243d0cb2cdff8975f8536cc27c41ad64a9ed488d23290ca5b3c8f83
reponame: marking blob
sha256:cd36502cd3983e7551ff652394a1e6fcf4d9f7eccb803d1d32f51428f69049fd
reponame: marking blob
sha256:1608c4eb107409f36213375f081a1da8ba5ecaf20c66c7bc1280588b76c1f119
reponame: marking blob
sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob
sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob
sha256:ecc87077c2f1492a5c7f20393d2b1e142b2e2b895de972ee19a646135d13b1c4
reponame: marking blob
sha256:c2763f167c24ca04a74d2d4ff09387d7829984572de3f3263e7e2e02403f8a5b
reponame: marking blob
sha256:ff987196669e52bba39baf261d89325bc846c1e5c66df6c4f9a4f0324582acb0
reponame: marking blob
sha256:5ad546d9f7f57c34742659bcab4b8daef9d43fd915da73a614a8f32a88523252
reponame: marking blob
sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob
sha256:022c49e390bcfb640b81bf50b7916f9ccf695c4313990b7fac0e2dbc0ebc61f1
reponame: marking blob
sha256:1487f06a9565df4ea85b993aca6cc8ddefe1d449f24523edca776c44f095def3
reponame: marking blob
sha256:ae6ce98ebd3173a28cdfffc4a28d87a60a1ca965511415f8c68fb92f6597de46
reponame: marking blob
sha256:f225f12ed645a098d8e0a27d3344cb413aee65023d08e0ad44aef7f28d14e3c9
reponame: marking blob
sha256:eeba15564580cbf840109e13f5c1195eb108551fda470e804bb533310740cefa
reponame: marking blob
sha256:56a14680f093bfdec694bd13555ec8efd2430b64a4df0ee8f915e8d87d8f5552
reponame: marking blob
sha256:61a37f5d7fb8a00c89b02a49eb67edfa4174a2639301cb890dd3e2ff92e5ecae
reponame: marking blob
sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob
sha256:16dc1f96e3a1bb628be2e00518fec2bb97bd5933859de592a00e2eb7774b6ecf
failed to garbage collect: failed to mark: invalid checksum digest format
So does this imply the last blob is somehow broken? What would be the
least damaging way to fix it? ( I assume that removal of things is the only
way to fix these ) Remove the manifest with the offending party?
thanks 👍 I also deleted the folder ,then retry the GC, it works
Hi,
I have the same problem. What folder did you deleted? Can you please give
an example?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1960 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGBG6QXZ2GOYF2RO5G2NBEDSR2C4FANCNFSM4CPRWPZQ>
.
Please add "disclaimer" it won't work for everyone. I thought its simple "mv" trick, lets save disk-space. It resulted in data loss - images gone :( May be it worked in 2018, but not in 2021.
This issue is due to an empty or corrupted (does not contain a valid digest) tag link file (/docker/registry/v2/repositories/<name>/_manifests/tags/<tag>/current/link).
While the root cause is yet unknown, I think it's safe to log a warn message and skip to the next tag instead of stoping GC. By doing so, the underlying manifest and blobs would be deleted, but only if they are not referenced elsewhere.
These tags are broken and can't be fixed unless they're pushed to the registry once again, so deleting them during GC is also a valid option.
@Lakshmipathi when you moved "some-app" back did you lose every image for that app?
If you remove a repository folder from the registry and run GC, any blobs that are only needed for the images within that repository will be deleted. So, once you move the repository folder back, you still have the tags there but the underlying blobs are gone and you can’t pull those images.
@KCD82 What @joaodrp mention is correct. I has 25 docker images, moved 1-image and reverted back after GC run. 24 images are fine but 1 image (which was "mv") pull always results in image not found since blobs are deleted.
Reacted by kcd83
naveenkumar-muniraj-agilysys commented on Oct 22, 2023
Nobody mentioned how to find the link with the 0 size. Use the following command to locate a link file with a size of 0 and remove it, retrying the garbage collection function.
find . -iname link -size 0
docker run -v /data/:/var/lib/registry registry:2 bin/registry garbage-collect /etc/docker/registry/config.yml
Reacted by Krzysztof, DoxeeQA, Adnan and José Ángel Pastrana
Nobody mentioned how to find the link with the 0 size. Use the following command to locate a link file with a size of 0 and remove it, retrying the garbage collection function.
find . -iname link -size 0
docker run -v /data/:/var/lib/registry registry:2 bin/registry garbage-collect /etc/docker/registry/config.yml
(Search brought me here.) Thanks for this. I simply removed this empty link and then garbage collection worked. IOW:
rm $(find /path/to/registry_data -iname link -size 0)
Reacted by Naveen Kumar Muniraj, Adnan and Andrey Kuznetsov
Activity
RichardScothern commentedon Sep 14, 2016
hi @lauriholmas
What is the last line printed in your dry run? My best guess is that there is a manifest which is not being parsed correctly. The 'marking manifest x' message should indicate which it is.
lauriholmas commentedon Sep 15, 2016
Hello @RichardScothern
here is the last section of the dry-run logs:
reponame: marking manifest sha256:437c175248b6014b7a257783333e8a3e44aa7b3a1838af02747c18ddb5d3a2dd
reponame: marking blob sha256:63cf8e9782dd9ff96aade2076b5cd510eb131f6c24987af8b7191b8bb8a47d52
reponame: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob sha256:31f838803b2beddabfbdf7fa62c4773ca611c78c3157dbccc6331e19f2289130
reponame: marking blob sha256:400b2f4fbd6a3edc11da4d16c5994668b6c3e5b510331f396b561858811959a5
reponame: marking blob sha256:dc1037d25537c058a775a28f0ff793383fce3c1873dba055c26a0b0e02fabeea
reponame: marking blob sha256:6b5a47d7a243d0cb2cdff8975f8536cc27c41ad64a9ed488d23290ca5b3c8f83
reponame: marking blob sha256:cd36502cd3983e7551ff652394a1e6fcf4d9f7eccb803d1d32f51428f69049fd
reponame: marking blob sha256:1608c4eb107409f36213375f081a1da8ba5ecaf20c66c7bc1280588b76c1f119
reponame: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob sha256:ecc87077c2f1492a5c7f20393d2b1e142b2e2b895de972ee19a646135d13b1c4
reponame: marking blob sha256:c2763f167c24ca04a74d2d4ff09387d7829984572de3f3263e7e2e02403f8a5b
reponame: marking blob sha256:ff987196669e52bba39baf261d89325bc846c1e5c66df6c4f9a4f0324582acb0
reponame: marking blob sha256:5ad546d9f7f57c34742659bcab4b8daef9d43fd915da73a614a8f32a88523252
reponame: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob sha256:022c49e390bcfb640b81bf50b7916f9ccf695c4313990b7fac0e2dbc0ebc61f1
reponame: marking blob sha256:1487f06a9565df4ea85b993aca6cc8ddefe1d449f24523edca776c44f095def3
reponame: marking blob sha256:ae6ce98ebd3173a28cdfffc4a28d87a60a1ca965511415f8c68fb92f6597de46
reponame: marking blob sha256:f225f12ed645a098d8e0a27d3344cb413aee65023d08e0ad44aef7f28d14e3c9
reponame: marking blob sha256:eeba15564580cbf840109e13f5c1195eb108551fda470e804bb533310740cefa
reponame: marking blob sha256:56a14680f093bfdec694bd13555ec8efd2430b64a4df0ee8f915e8d87d8f5552
reponame: marking blob sha256:61a37f5d7fb8a00c89b02a49eb67edfa4174a2639301cb890dd3e2ff92e5ecae
reponame: marking blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
reponame: marking blob sha256:16dc1f96e3a1bb628be2e00518fec2bb97bd5933859de592a00e2eb7774b6ecf
failed to garbage collect: failed to mark: invalid checksum digest format
So does this imply the last blob is somehow broken? What would be the least damaging way to fix it? ( I assume that removal of things is the only way to fix these ) Remove the manifest with the offending party?
RichardScothern commentedon Sep 15, 2016
What do the manifests for
reponamelook like? Are there any non-standard digests in the layers sections?lauriholmas commentedon Sep 16, 2016
Hello, went digging in, there is an empty link file under
reponame/_manifests/revisions/sha256/437c175248b6014b7a257783333e8a3e44aa7b3a1838af02747c18ddb5d3a2dd/signatures/sha256/285fcc9d2080173304921fc55fd52793a9cf643575ae3372be0c51fae6ffac0a/link
( that manifest being the last manifest to be mentioned in the log )
Looked at a couple others and they had content in them.
RichardScothern commentedon Sep 16, 2016
A missing signature isn't ideal, but if you're running 2.5.0 or later it should not interfere with GC.
If you increase the log level to debug does anything else show up?
lauriholmas commentedon Sep 30, 2016
Hmm, I will try to rerun GC with debug logs on once I get back to work after paternal leave. ( Just explaining the delay in replies, I'm sure you are not holding your breath waiting anyway =) )
johnbazan commentedon Oct 20, 2016
I'm having exactly the same issue, even using docker registry 2.5.1
Is it safe to remove those empty links (and it's folders) and run the garbage collector again?
I'm moving them to a backup folder just in case, and running dry-run.
I've found 5 by now.
Sorry to bother you guys, but I need a response asap, hehe.
gcrova commentedon Dec 7, 2016
Hi,
Did your find a solution for this problem ? I'm encountering the same issue with registry 2.5.1.
Thanks
lauriholmas commentedon Dec 7, 2016
I ended up rebuilding the registry I am maintaining and haven't bumped into this one with the new one yet. I was using an S3 implementation via s3fs,( filesystem storagedriver) I went with the assumption that it was an issue in that. What storage method are you running on?
gcrova commentedon Dec 7, 2016
The storage we are using is a nfs mount to a nas server. Do you think it might be the problem ?
johnbazan commentedon Dec 7, 2016
I've removed the empty links and the gc eventually ran. Didn't find the answer to this yet. I increased the storage size of my registry and never run the gc again.
gcrova commentedon Dec 8, 2016
Hi,
That's finally what I did too. I identified & removed all empty links files and the garbage collect process looks complete.
Problem is that garbage collect looks not removing all useless data ... Is there a way to force it to remove all useless data ?
Thanks
gogeof commentedon Jul 19, 2018
the same in v2.6.2
kcd83 commentedon Aug 22, 2018
I was able to delete other images by shelving the problem one
and putting it back.Unreferenced blobs seem to be deleted from the internal database, people below report them as deleted, so moving back does not work
Doesn't resolve the actual issue
mehyedes commentedon Oct 31, 2018
@kcd83 Thanks, that saved our day!
I am still wondering, what's the actual reason for this issue..
depfsh commentedon Dec 23, 2018
thanks 👍 I also deleted the folder ,then retry the GC, it works
ganeshpore commentedon Aug 27, 2019
docker run -it --name gc --rm -v /opt/registry/data/registry:/var/lib/registry -v /opt/registry/conf/registry/config.yml:/etc/docker/registry/config.yml registry:2.6.2 garbage-collect /etc/docker/registry/config.yml
[root@dharbor registry]# docker run -it --name gc --rm -v /opt/registry/data/registry:/var/lib/registry -v /opt/registry/conf/registry:/etc/docker/registry/config.yml registry:2.6.2 garbage-collect /etc/docker/registry/config.yml
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused "rootfs_linux.go:58: mounting \"/opt/registry/conf/registry\" to rootfs \"/var/lib/docker/overlay2/9ea840a3bac96908d677cb9ef0cf4d963ad04c34583f8b5d147fd4b4a861dd33/merged\" at \"/var/lib/docker/overlay2/9ea840a3bac96908d677cb9ef0cf4d963ad04c34583f8b5d147fd4b4a861dd33/merged/etc/docker/registry/config.yml\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled
ganeshpore commentedon Nov 27, 2020
Lakshmipathi commentedon Feb 6, 2021
@kcd83,
Please add "disclaimer" it won't work for everyone. I thought its simple "mv" trick, lets save disk-space. It resulted in data loss - images gone :( May be it worked in 2018, but not in 2021.
joaodrp commentedon Feb 6, 2021
This issue is due to an empty or corrupted (does not contain a valid digest) tag link file (
/docker/registry/v2/repositories/<name>/_manifests/tags/<tag>/current/link).While the root cause is yet unknown, I think it's safe to log a warn message and skip to the next tag instead of stoping GC. By doing so, the underlying manifest and blobs would be deleted, but only if they are not referenced elsewhere.
These tags are broken and can't be fixed unless they're pushed to the registry once again, so deleting them during GC is also a valid option.
kcd83 commentedon Feb 7, 2021
@Lakshmipathi when you moved "some-app" back did you lose every image for that app?
joaodrp commentedon Feb 7, 2021
If you remove a repository folder from the registry and run GC, any blobs that are only needed for the images within that repository will be deleted. So, once you move the repository folder back, you still have the tags there but the underlying blobs are gone and you can’t pull those images.
Lakshmipathi commentedon Feb 7, 2021
@KCD82 What @joaodrp mention is correct. I has 25 docker images, moved 1-image and reverted back after GC run. 24 images are fine but 1 image (which was "mv") pull always results in
image not foundsince blobs are deleted.naveenkumar-muniraj-agilysys commentedon Oct 22, 2023
Nobody mentioned how to find the link with the 0 size. Use the following command to locate a link file with a size of 0 and remove it, retrying the garbage collection function.
find . -iname link -size 0
docker run -v /data/:/var/lib/registry registry:2 bin/registry garbage-collect /etc/docker/registry/config.yml
MMI commentedon Mar 21, 2024
(Search brought me here.) Thanks for this. I simply removed this empty link and then garbage collection worked. IOW:
shuaichang commentedon Jun 25, 2024
Does this bug still exist today? We also see empty link files. However, we did not do any GC operation
Code42Cate commentedon Jan 31, 2025
Just had it today. Still exists on
registry:3.0.0-beta.1abhinavsingh commentedon Jun 4, 2025
Got bit by this today, unsure how to get out of it now.
find /var/lib/registry -iname link -size 0--- Gives me nothingningmingxiao commentedon Jan 30, 2026
this pr may fix #4774
I guess it happended on unexpected poweroff.