# Gettiing 401 unathorized error for image replication

**URL:** https://community.sonatype.com/t/gettiing-401-unathorized-error-for-image-replication/12245
**Category:** Sonatype Nexus Repository
**Tags:** integrations, docker, nexus-repository
**Created:** [March 12, 2024, 5:05pm UTC](https://community.sonatype.com/t/gettiing-401-unathorized-error-for-image-replication/12245 "2024-03-12T17:05:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shanimakthahir7](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shanimakthahir7](https://community.sonatype.com/u/shanimakthahir7)
#### Post date: [March 12, 2024, 5:05pm UTC](https://community.sonatype.com/t/gettiing-401-unathorized-error-for-image-replication/12245/1 "2024-03-12T17:05:05Z")

</div>

Hi Team,

We have set up a proxy Docker registry in Nexus, with a remote repository being proxied from [https://registry.opencode.de](https://registry.opencode.de). In Harbor, we configured a replication rule with a pull-based replication mode. The source registry in Harbor is set as the Nexus proxy registry, with the remote repository configured as “opencode” in Nexus.

Our goal is to replicate images in Harbor via the Nexus proxy, using the URL pattern [https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/](https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/)\*\*. However, we are encountering a 401 unauthorized error from [https://registry.opencode.de](https://registry.opencode.de), as indicated in the Nexus logs.

++++++++++++++++

[08/Mar/2024:13:47:04 +0000] _ **@**"GET [https://gitlab.opencode.de/jwt/auth?service=container\_registry&scope=registry%3Acatalog%3A](https://gitlab.opencode.de/jwt/auth?service=container_registry&scope=registry%3Acatalog%3A)_  
HTTP/1.1" 200 2550 392 “Nexus/3.64.0-04 (OSS; Linux; 4.14.65-gentoo; amd64; 1.8.0\_392)” [qtp1414918440-1023]  
[08/Mar/2024:13:47:04 +0000] **@** “GET [https://registry.opencode.de/v2/\_catalog](https://registry.opencode.de/v2/_catalog)  
HTTP/1.1” 401 162 1025 “Nexus/3.64.0-04 (OSS; Linux; 4.14.65-gentoo; amd64; 1.8.0\_392)” [qtp1414918440-1023]

++++++++++++++++

Interestingly, we can successfully replicate images from Harbor when attempting to replicate one image at a time. For example, if we use the URL [https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/bundesmessenger-call](https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/bundesmessenger-call), the replication works without issues.

Related logs from Nexus

+++++++++++++++++

[08/Mar/2024:09:13:09 +0000] - “GET [https://gitlab.opencode.de/jwt/auth?service=container\_registry&scope=repository%3Abwi%2Fbundesmessenger%2Fbackend%2Fcontainer-images%2Fbundesmessenger-call%3Apull](https://gitlab.opencode.de/jwt/auth?service=container_registry&scope=repository%3Abwi%2Fbundesmessenger%2Fbackend%2Fcontainer-images%2Fbundesmessenger-call%3Apull)  
HTTP/1.1” 200 2607 314 “Nexus/3.64.0-04 (OSS; Linux; 4.14.65-gentoo; amd64; 1.8.0\_392)” [qtp1414918440-580]  
[08/Mar/2024:09:13:10 +0000] - “GET [https://registry.opencode.de/v2/bwi/bundesmessenger/backend/container-images/bundesmessenger-call/blobs/sha256:7288cfc48d463d9589db9727752633ec0fb105506a17fcbd07cbebadaa26a58f](https://registry.opencode.de/v2/bwi/bundesmessenger/backend/container-images/bundesmessenger-call/blobs/sha256:7288cfc48d463d9589db9727752633ec0fb105506a17fcbd07cbebadaa26a58f)  
HTTP/1.1” 307 0 765 “Nexus/3.64.0-04 (OSS; Linux; 4.14.65-gentoo; amd64; 1.8.0\_392)” [qtp1414918440-580]  
[08/Mar/2024:09:13:10 +0000] - “GET [https://s3b.wx-one.com/oc-registry/docker/registry/v2/blobs/sha256/72/7288cfc4xxxxxxxx27752633ec0fb105506a17fcbd07cbebadaa26a58f/data?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=jfMxc\*\*\*\*\*\*\*\*\*\*240308%2\*\*-Amz-Signature=6c](https://s3b.wx-one.com/oc-registry/docker/registry/v2/blobs/sha256/72/7288cfc4xxxxxxxx27752633ec0fb105506a17fcbd07cbebadaa26a58f/data?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=jfMxc **********240308%252** -Amz-Signature=6c)\*\*\*\*\*\*  
HTTP/1.1” 200 622 173 “Nexus/3.64.0-04 (OSS; Linux; 4.14.65-gentoo; amd64; 1.8.0\_392)” [qtp1414918440-580]

+++++++++++++++++

We are seeking assistance in identifying the reason behind our ability to replicate one image at a time, while encountering a 401 unauthorized error when attempting to replicate all images from the repository [https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/](https://nexusexmaple.com/bwi/bundesmessenger/backend/container-images/).

It’s worth noting that we have checked Harbor logs, but there are no reported errors related to the replication process on the Harbor side.

---

<div class="post-metadata">

### Author: ![timl](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@timl](https://community.sonatype.com/u/timl)
#### Post date: [March 13, 2024, 12:27pm UTC](https://community.sonatype.com/t/gettiing-401-unathorized-error-for-image-replication/12245/2 "2024-03-13T12:27:41Z")

</div>

Also got the similar issue when run mvn gpg:sign-and-deploy CLI

```auto
**19:44:30** [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign-and-deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact ***.*** rapids-4-spark-tools_2.12:jar:24.02.1 from/to ossrh (https://oss.sonatype.org/service/local/staging/deploy/maven2): Transfer failed for https://oss.sonatype.org/service/local/staging/deploy/maven2/ ***/*** /rapids-4-spark-tools_2.12/24.02.1/rapids-4-spark-tools_2.12-24.02.1.jar 401 Unauthorized -> [Help 1]

```

---

<div class="post-metadata">

### Author: ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)
#### Post date: [March 14, 2024, 5:16pm UTC](https://community.sonatype.com/t/gettiing-401-unathorized-error-for-image-replication/12245/3 "2024-03-14T17:16:16Z")

</div>

Hi Tim you should follow the support channels for OSSRH. This forum is for general questions about Nexus.
