About point 1: I tried to remove another image in another project registry and I ended with the same result. How can this be fixed? I cannot believe this is a bug in Gitlab nobody hit before me…
I have been able to clear the situation by manually removing everything related to the project from the Minio bucket, obviously now the registry is empty but at least no error is shown
I found that the push succeeds if I login to the registry with a personal token with write_registry scope and then manually start docker push, but fails as above when the CI job logs in with CI_JOB_TOKEN. In my knowledge CI_JOB_TOKEN grants the same permissions as the user that started the job, so in my case registry write should be granted since I am the owner of the project (and also the instance admin). How can I troubleshoot this issue?
Did you find a solution? My CI/CD pipelines are also failing with this error now but this must be a recent issue (perhaps when I upgraded Gitlab)? I am the Owner so I have all permissions.
Shame, I was hoping you had the solution. I just can’t figure this out. The networking team does not see any blocked traffic or anything like that but I just have to go on their word. Locally, I was able to push some images but not others and it seems to fail on the very last layer. The registry uses workload identity and has storage permissions, my gitlab user is the admin and owner, etc. This has worked for over a year so I just have no idea what has changed.
python:3.12-slim-bookworm was being flagged as Virus/Linux.WGeneric.eizzgy which caused the blob PATCH to fail for one of the layers. Not sure if your issue is caused by something similar or not, but good luck.
After some time I have bee able to look at this issue again. Now after several updates I’m on Gitlab 17.2.2 and I discovered that:
no more images are present in the registry of the problematic project
the push problem persists. The strange thing is that during push Docker says that Layer already exists for some layers, even if no image is present on the registry and thus I suspect something bad happened under the hood in the Gitlab registry. Unfortunately I still don’t know how to investigate further, I’ll have to do some research
So 1 vanished by itself, no idea what did the job, while for 2 I’m still in open waters.
I finally found and fixed the problem n. 2. The reason was a timeout of the Traefik reverse proxy running on front of the Gitlab deployment. Something similar happened in the past in my setup, preventing CI runners to upload big artifacts, and I fixed it by increasing the read timeout as follows:
Unfortunately this works only for the websecure entrypoint managing traffic on port 443, while the Docker registry port is set to 5050 in my setup. So I had to add also:
And finally I solved also problem n. 1. I had to migrate the Minio S3 backend to a new infrastructure, so following the migration suggestions I enabled bucket versioning on both the old and the new Minio instances for automatic synchronization, then paused it after the migration (it seems versioning can’t be disabled but just paused). But even with paused versioning, for some reasons I don’t understand, when deleting files in the registry bucket only delete markers were created and no actual deletion was performed. This resulted in “folders” being still visible but without any content, and this generated the problem with Gitlab.
Since as I wrote above it seems impossible to get rid of this behavior I fixed the problem with this procedure:
stop the Gitlab instance
create a backup bucket for the registry and copy the content of the registry bucket into it
delete the old registry bucket
recreate the registry bucket with the same name
copy the content of the backup bucket into the new registry bucket
delete the backup bucket
restart Gitlab
For those curious about why the procedure is so involved: it seems that Minio buckets cannot be renamed…
Created an account just to say thank you for posting this, I had also not set this in my traefik proxy and running into timeout issues and now is all resolved. Thanks for the persistence in updating the thread OP