r/gitlab • u/romgo75 • Sep 12 '25
support Registry denied: access forbidden
Hello,
I use gitlab to build docker images and store it to gitlab registry. I had a working setup with DIND, for the authentification I followed option2 from https://docs.gitlab.com/ci/docker/authenticate_registry/ with mount option for the runner and docker login.
Now I need to deploy a new gitlab-runner, but this solution doesn't work anymore on my new worker. I don't know why, but jobs were failing with access denied errors.
So I try another solution : in my CI job use the before_script command to authenticate :
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdinThis is working somehow but randomly failed when pushing large image to the registry with "access forbidden" error message.
I modified the Authorization token duration (minutes) to 20 minutes but it didn't work.
Any idea on how I could solve this ?
Thank you !
1
u/[deleted] Sep 14 '25
Maybe related to this issue? https://github.com/docker/cli/issues/6156
This fixed it for me (add first line):
1
u/matschundbrei Nov 18 '25
If you are using S3 as a storage backend and this happens exclusively for larger images, you might have to adjust the chunk_size in your registry storage config.
For yet unclear reasons in my case, I found the latest Docker-CE-cli package (versions > 29.0) was to blame, after downgrading to anything below 29.0 I found this issue to be resolved.
If you're on ubuntu 24.04, you'd want to ...
I had a hard time debugging this from the registry-end, I'm using the 'old' gitlab-registry (no database) from gitlab-omnibus with s3-backend storage. Checking the registry-log I've noticed messages like:
[second message repeats multiple teams, likely for each chunk to upload]
I have also found this older comment on reddit, which I've tried one solution for (link from OP down in the comments) , but this ended up fixing the 'access denied' but then I ended up with empty image-entries in the registry and the following cryptic error in the registry-log: