Integrate Sonatype Nexus with Google Artifact Registry for RPM

Need to configure Sonatype Nexus has a proxy (format yum / proxy) to Google Artifact Registry for RPM. For the authentication on Google used the an service account and on the configuration for the user put Username =_json_key and on the Password the content of the SA. When I tried to access the GAR using Nexus has a proxy I got this error. Is there any configurations that is missing ?

[root@infra-dev-server-tmarques ~]# yum list
Google64 1.2 kB/s | 1.5 kB 00:01
Errors during downloading metadata for repository ‘google64’:

If I connect directly to GAR with the SA it works fine.

Hi, you’d need to take a look at the logs from Nexus to understand what the issue is.

On the logs file I have the same information that I provided, status code 404, no clues about the error. Can you give an example of the configuration that needs to be done on Sonatype to compare with what I done ?

Perhaps the configuration of the repository doesn’t have the correct URL for proxying. I believe for Yum that the request paths directly map onto the remote.

i.e. http://10.112.14.144:8081/repository/alb-yum-proxy-google_base64/repodata/repomd.xml would map to https://host/path/repodata/repomd.xml

Additional information on the logs:

2024-09-21 19:57:17,028+0100 DEBUG [qtp2020819268-3123] *UNKNOWN org.sonatype.nexus.repository.cache.NegativeCacheHandler - Handling NotFoundCache for PathNegativeCacheKey{path=‘/repodata/repomd.xml’}
2024-09-21 19:57:17,029+0100 DEBUG [qtp2020819268-3123] *UNKNOWN org.sonatype.nexus.repository.cache.NegativeCacheHandler - Found PathNegativeCacheKey{path=‘/repodata/repomd.xml’} in negative cache, returning Response{status=Status{successful=false, code=404, message=‘null’}, payload=null}

I tried adding the repodata/repomd.xml on the path and it did not work, the error is still the same

[root@infra-dev-server-tmarques yum.repos.d]# dnf list
Google 7.0 kB/s | 1.5 kB 00:00
Errors during downloading metadata for repository ‘google’:

This suggests the URL configured as the remote is not correct, or that the yum client isn’t configured correctly.

Hi, can you provide a sample configuration (printscreen) of you have configured on the Nexus application and a sample of the /etc/yum.repos.d/ file ? we have tried several configuration and no one works.

Hi

Answering to your question, the URL is correct