Gettiing 401 unathorized error for image replication - Sonatype Nexus Repository - Sonatype Community

Gettiing 401 unathorized error for image replication

post by shanimakthahir7 on Mar 12, 2024

Hi Team,

We have set up a proxy Docker registry in Nexus, with a remote repository being proxied from 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/**. However, we are encountering a 401 unauthorized error from 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 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 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, 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 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 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***

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/.

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.

post by timl on Mar 13, 2024

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

**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]

post by mpiggott on Mar 14, 2024

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

New & Unread Topics

Topic Replies Views Activity
How could I find out the role name 1 65 Aug 2025
Can’t downgrade from Nexus Pro to Nexus OOS in 3.83.0 1 183 Aug 2025
Redhat registry error 6 432 Aug 2025
Default role loading failure after upgrade to version 3.84.0 4 199 Sep 2025
Failed to make connection to backend after upgrade to nexus 3.78.2 1 180 Oct 2025

Topic list, column headers with buttons are sortable.