# Proxied Docker Repository fails to pull images

**URL:** <https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033>\
**Category:** Sonatype Nexus Repository\
**Created:** [March 9, 2021, 4:08pm UTC](https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033 "2021-03-09T16:08:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sverre.moe](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sverre.moe](https://community.sonatype.com/u/sverre.moe)\
**Post date:** [March 9, 2021, 4:08pm UTC](https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033/1 "2021-03-09T16:08:11Z")

</div>

I have set up 2 Docker Registry proxies

SUSE: [https://registry.suse.com](https://registry.suse.com)  
HTTPS Connector 38382  
Allow anonymous docker pull  
Docker Index: Use proxy registry

Docker Hub: [https://registry-1.docker.io](https://registry-1.docker.io)  
HTTPS Connector 38383  
Allow anonymous docker pull  
Docker Index: Use Docker Hub

I got the Docker Hub registry URL from this documentation:  
[https://help.sonatype.com/repomanager3/formats/docker-registry/proxy-repository-for-docker](https://help.sonatype.com/repomanager3/formats/docker-registry/proxy-repository-for-docker)

All these are combined within a Docker Group along with our own internal hosted Docker registry. This group has HTTPS Connector on port 38380.

- Pulling from the internal hosted registry works fine through the docker group.

- Pulling from SUSE images through the group:  
docker pull [nexus.company.com:38380/suse/sle15:15.2](http://nexus.company.com:38380/suse/sle15:15.2)  
15.2: Pulling from suse/sle15  
f3d2df4815db: Pulling fs layer  
error pulling image configuration: unknown blob

- Pulling from Docker Hub images through the group:  
docker pull [nexus.company.com:38380/opensuse/leap:15.2](http://nexus.company.com:38380/opensuse/leap:15.2)  
Error response from daemon: manifest for [nexus.company.com:38380/opensuse/leap:15.2](http://nexus.company.com:38380/opensuse/leap:15.2) not found: manifest unknown: manifest unknown

When I try to pull from the proxied registries directly.

Pulling directly from SUSE proxy  
docker pull [nexus.company.com:38382/suse/sle15:15.2](http://nexus.company.com:38382/suse/sle15:15.2)  
15.2: Pulling from suse/sle15  
f3d2df4815db: Pulling fs layer  
error pulling image configuration: unauthorized: access to the requested resource is not authorized

Pulling from Docker Hub proxy  
docker pull [nexus.company.com:38383/opensuse/leap:15.2](http://nexus.company.com:38383/opensuse/leap:15.2)  
Error response from daemon: unauthorized: access to the requested resource is not authorized

What does this mean?  
Is it our Nexus or the proxy registry who says it is not authorized?  
Anonymous pull is toggled, and I have the Docker Bearer Token Realm in Realms.

I have even tried `docker login`, but that does not help.

So, three problems:

1. Why doesn’t Nexus search the proxied registries when using the Group?
2. Why is it saying Unauthorized when using the proxied registries directly through their connector port?
3. What was the problem I got with the blobstore for the one proxy repository?

---

<div class="post-metadata">

**Author:** ![sverre.moe](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sverre.moe](https://community.sonatype.com/u/sverre.moe)\
**Post date:** [March 11, 2021, 6:32pm UTC](https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033/3 "2021-03-11T18:32:54Z")

</div>

It seems so easy how to configure Nexus to proxy Docker Hub, but I cannot fathom why it does not work.  
I have tried every configuration I can think of.

On the Nexus server, I am able to pull directly from Docker Hub using `docker`.

Why is it saying I am not authorized? It will not work with `docker login` either.

---

<div class="post-metadata">

**Author:** ![sverre.moe](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sverre.moe](https://community.sonatype.com/u/sverre.moe)\
**Post date:** [March 17, 2021, 5:26pm UTC](https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033/4 "2021-03-17T17:26:35Z")

</div>

I am not sure what the problem was.  
We have fixed it.

We moved our Nexus server to a different network segment.  
Disabled HTTP and HTTPS Proxy in Nexus settings.  
Firewall opening have been made to the external registries.  
Now the group pull retrieves from the external registries.

Perhaps some problem with HTTPS Proxy was the cause.

---

<div class="post-metadata">

**Author:** ![blackclaws.kearal](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/blackclaws.kearal/32/1766_2.png) [@blackclaws.kearal](https://community.sonatype.com/u/blackclaws.kearal)\
**Post date:** [April 14, 2021, 7:31pm UTC](https://community.sonatype.com/t/proxied-docker-repository-fails-to-pull-images/6033/5 "2021-04-14T19:31:03Z")

</div>

For me this solved the problem:

> <https://github.com/moby/moby/issues/30880#issuecomment-763273957>
>
> \*\*Description\*\*
> 
> I've just login to my private mirror using docker login. My a…uth informations are up to date in ~/.docker/config.json
> 
> when I do : 
> \`$ docker pull nexus3.pleiade.mycomp.fr:5000/hello-world\`
> it works, my auth informations are used.
> 
> but when I do : 
> \`$ docker pull hello-world\`
> it fails to authenticate to "nexus3.pleiade.mycomp.fr" who is declared as mirror (using --registry-mirror).
> 
> and I can see this in logs : 
> level=error msg="Attempting next endpoint for pull after error: Get https://nexus3.pleiade.mycomp.fr:5000/v2/library/hello-world/manifests/latest: no basic auth credentials"
> 
> 
> \*\*Additional information you deem important (e.g. issue happens only occasionally):\*\*
> See more details on : http://stackoverflow.com/questions/42143395/docker-registry-mirror-not-used
> 
> \*\*Output of \`docker version\`:\*\*
> 
> \`\`\`
> Client:
> Version: 1.13.1
> API version: 1.26
> Go version: go1.7.5
> Git commit: 092cba3
> Built: Wed Feb 8 06:50:14 2017
> OS/Arch: linux/amd64
> 
> Server:
> Version: 1.13.1
> API version: 1.26 (minimum version 1.12)
> Go version: go1.7.5
> Git commit: 092cba3
> Built: Wed Feb 8 06:50:14 2017
> OS/Arch: linux/amd64
> Experimental: false
> \`\`\`
> 
> \*\*Output of \`docker info\`:\*\*
> 
> \`\`\`
> Containers: 0
> Running: 0
> Paused: 0
> Stopped: 0
> Images: 0
> Server Version: 1.13.1
> Storage Driver: overlay2
> Backing Filesystem: extfs
> Supports d\_type: true
> Native Overlay Diff: true
> Logging Driver: json-file
> Cgroup Driver: cgroupfs
> Plugins: 
> Volume: local
> Network: bridge host macvlan null overlay
> Swarm: inactive
> Runtimes: runc
> Default Runtime: runc
> Init Binary: docker-init
> containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
> runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
> init version: 949e6fa
> Security Options:
> apparmor
> seccomp
> Profile: default
> Kernel Version: 4.8.0-37-generic
> Operating System: Ubuntu 16.10
> OSType: linux
> Architecture: x86\_64
> CPUs: 2
> Total Memory: 15.67 GiB
> Name: vm-087
> ID: 6RAV:3CHE:F5A2:YFIV:U35V:AQUW:757Q:BWCO:YUFJ:DPIG:MHRI:UJ6V
> Docker Root Dir: /var/lib/docker
> Debug Mode (client): false
> Debug Mode (server): false
> Registry: https://index.docker.io/v1/
> WARNING: No swap limit support
> Experimental: false
> Insecure Registries:
> 127.0.0.0/8
> Registry Mirrors:
> https://nexus3.pleiade.mycomp.fr:5000/
> Live Restore Enabled: false
> \`\`\`
> 
> I've found similar issues, but none where I could clearly understand the answer (is it a bug ? or is it a docker limitation which won't be fixed and has to be worked around ? Or is it a Sonatype Nexus 3 bug, wich I doubt since explicit login works ?). https://github.com/docker/docker/issues/20097

Basically add a default role to every authenticated user as nx-anonymous:  
nexus configuration → system → capabilities → create capability → default role
