Add yum repo to Sonatype Nexus Repository in Proxy mode

Im new with Nexus Repository ( using OSS 3.37 in RHEL 7.7). Im trying to add a simple Yum repo. What i do:

Name: CentosRepo
Proxy > Remote Storage: "http://mirror.centos.org/centos/"
Storage > Blob Store: "default"

Finally URL to access will be http://<IP_OF_NEXUS>:8081/repository/CentosRepo/

When i try to access by using the URL i got:

*This yum proxy repository is not directly browseable at this URL.* 

I found in [1]: Doc from help.sonatype same steps that i made.

I made the same steps using a APT repo and i can access using http://<IP_OF_NEXUS>:8081/repository/UbuntuRepo/

Config:

Name: UbuntuRepo
Proxy > Remote Storage: "http://archive.ubuntu.com/ubuntu/"
Storage > Blob Store: "default"

Also I use same URL from UbuntuRepo and CentosRepo using a “raw proxy” type of Repository. UbuntuRepo works, but CentosRepos didnt.

The URL is meant to be accessed by a yum/dnf client, not your browser so you shouldn’t expect a response.

I tried to add it in yum repo list using:

[user9@zzzz-zzzzzz ~]$ cat /etc/yum.repos.d/nexus.repo
[CentosRepo]
name=CentosRepo
baseurl=http://<IP_OF_NEXUS>:8081/repository/CentosRepo/
enabled=1
#skip_if_unavailable=1
#gpgcheck=0
#sslverify=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

This is the way to test it ? because then i made a “sudo yum update” and i got:

failure: repodata/repomd.xml from CentosRepo: [Errno 256] No more mirrors to try.
http://<IP_OF_NEXUS>:8081/repository/CentosRepo/repodata/repomd.xml: [Errno 14] HTTP Error 500 - Internal Server Error

The 500 error suggests you should be able to find an exception in the Nexus log.

Hello, sorry for this old response. First issue was that i didnt have RHEL registered. I made it and then i try again, I made a repo called “PEPO” :smile: Then i add it in yum repo into the same VM when Nexus is running :
I made a “yum update” and says:

http://<IP_NEXUS>:8081/repository/PEPO/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
Trying other mirror.


 One of the configured repositories failed (PEPO),.......

Status in NEXUS in PEPO repo : “Online - Remote Unavailable . Internal Server Error”
LOG in NEXUS:

2022-12-01 09:27:02,915+0000 INFO  [qtp601217775-606]  admin org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Updating repository: PEPO -> OrientConfiguration{repositoryName='PEPO', recipeName='yum-proxy', attributes={yumSigning={keypair=, passphrase=}, proxy={remoteUrl=http://<REMOTE_IP_REPO>/yum/, contentMaxAge=1440.0, metadataMaxAge=1440.0}, httpclient={blocked=false, autoBlock=false, connection={userAgentSuffix=, retries=null, timeout=20.0, enableCircularRedirects=false, enableCookies=false}}, storage={blobStoreName=default, strictContentTypeValidation=true}, negativeCache={enabled=true, timeToLive=1440.0}}}
2022-12-01 09:27:02,922+0000 INFO  [qtp601217775-606]  admin org.sonatype.nexus.repository.httpclient.internal.HttpClientFacetImpl - Remote connection status of repository PEPO set to Ready to Connect.
2022-12-01 09:27:11,201+0000 INFO  [qtp601217775-614]  *UNKNOWN org.sonatype.nexus.repository.httpclient.internal.HttpClientFacetImpl - Repository status for PEPO changed from READY to UNAVAILABLE - reason Internal Server Error for http://10.193.59.206
2022-12-01 09:27:11,202+0000 WARN  [qtp601217775-614]  *UNKNOWN org.sonatype.nexus.repository.yum.orient.internal.proxy.OrientYumProxyFacetImpl - Exception org.sonatype.nexus.repository.proxy.ProxyServiceException: HTTP/1.1 500 Internal Server Error checking remote for update, proxy repo PEPO failed to fetch repodata/repomd.xml with status line HTTP/1.1 500 Internal Server Error, content not in cache.
2022-12-01 09:27:11,210+0000 WARN  [qtp601217775-581]  *UNKNOWN org.sonatype.nexus.repository.yum.orient.internal.proxy.OrientYumProxyFacetImpl - Exception org.sonatype.nexus.repository.proxy.ProxyServiceException: HTTP/1.1 500 Internal Server Error checking remote for update, proxy repo PEPO failed to fetch repodata/repomd.xml with status line HTTP/1.1 500 Internal Server Error, content not in cache.

Just mention that i can do “ping <REMOTE_IP_REPO>”

Something that i didnt mention. Nexus is running in a Container with port exposed.


docker run -d -p 8081:8081 --name nexus -v /opt/nexus-home:/nexus-home -v /opt/nexus-data:/nexus-data  -e INSTALL4J_ADD_VM_PARAMS="-Xms4G -Xmx4G -XX:MaxDirectMemorySize=6717M -Djava.util.prefs.userRoot=/nexus-home" sonatype/nexus3

Last Update. Problem was fixed. The problem was that i had the Proxy configured in Nexus so i was having issues with that.