Docker image pull error invalid character

Viewed 6432

I am trying to pull a docker image from the DTR and I am getting below error

#docker pull repo/appname
Trying to pull repository  repo/appname ...
Pulling repository repo/appname
**invalid character '<' looking for beginning of value**

I am not sure what's wrong. I just googled and found below link related to the error but no help.

https://github.com/stripe/stripe-go/issues/642

3 Answers

A previous answer suggested a network issue.

In your case, regarding access to a DTR (Docker Trusted Registry), it could also be a right issue.
For example, if a docker login is needed in order to access that image, a 404 HTML page would be send back, and a docker command would not know how to interpret an HTML answer (starting with <!DOCTYPE html>), hence the invalid character '<')

Actually, BMitch helpfully points out in the comments the DTR would send back a json message, not HTML:

This < is from something else intercepting the request before it gets to the registry API.

Something is capturing the request before it makes it to the registry API. Network proxy, or a reverse proxy within the container.
Either way the docker login shouldn't help.

I'd curl the registry url/port and see what is generating the error.

The issue in my case was actually the image was missing in DTR. I din't knew they have multiple DTR's with almost similar names (except few characters) in my organization. So the image was pushed to ABC DTR but the pull was looking into XYZ DTR. Hence I got the above error. I am able to successfully pull the image from the right DTR.

My issue was that Docker Desktop was out of date. Once I updated that, it worked. When loading Docker Desktop I saw a "failed" message there too.

Related