Error response from daemon: error parsing HTTP 404 response body: unexpected end of JSON input: ""

Docker version: 27.3.1-1 and 28.0.4-1
OS: EndeavourOS (Arch based)

Brief

I’m trying to push/pull images from a private gitlab repository.

Reproduction

I start by login in with:

echo $GITLAB_TOKEN | docker login -u $GITLAB_USER --password-stdin registry.MYREGISTRY.com

Login Succeeded

Then I pull the image:

docker pull registry.MYREGISTRY.com/MYPROJECT/MYREPO/IMAGE_TITLE:latest

which gives me:

Error response from daemon: error parsing HTTP 404 response body: unexpected end of JSON input: “”

Possible explanation

It is essentially getting an 404 html page from gitlab instead of a json with the manifest.

What I’ve tried

  • Producing new tokens (both project tokens and personal tokens, both with read_registry and write_registry, and the appropriate permission level)
  • Downgrading docker and restarting the daemon
  • Using someone else’s keys in the .docker/conf.json
  • Deleting .docker, removing the docker package and reinstalling
  • Using another computer with my credentials (docker version 27.3.1)

No one else in my team is having/has had this issue.
Nothing seems to fix it. People have told me no changes have been made to the company gitlab host.

If everyone else can access the gitlab registry at your company, then there could be a proxy setting on your machine. Since the login command worked, it is possible that only some URLs are blocked by that proxy setting or that you mistype something in the image URL, but I don’t think it would result an HTTP 404,

You could ask the GitLab administrators to check the GitLab access logs if they see anything logged triggered by your request. Something has to return that HTTP 404, and only the server could tell what was requested.

Or you could try curl to see if that can access the URL, but you can search for similar issues on the GitLab forum

Fixed: the solution was adding

registry_nginx['listen_addresses'] = ['*', '[::]']

to the gitlab.conf file on the server side. The server just wasn’t listening to my registry calls and forwarded me onto the https server.

Config is in gitlab.rb

Full solution for enable ipv6 on gitlab with registry

sudo nano /etc/gitlab/gitlab.rb

add

nginx['listen_addresses'] = ['*', '[::]']
registry_nginx['listen_addresses'] = ['*', '[::]']

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart nginx