When repomd.xml is fetched through a yum proxy then Nexus automatically fetches the primary.xml.gz file so that it can remove any absolute urls, and update the checksum and size attributes that are stored in repomd.xml.
This works fine when the metadata is at the root of the repository. (i.e. remote url of http://mirror.centos.org/centos/7/os/x86_64 and a request url of http://localhost:8081/repository/yum-proxy/repodata/repomd.xml).
It fails when metadata is not at the root because it uses the path directly from the repomd.xml.
- Create a yum proxy repository with remote url http://mirror.centos.org/centos
- Fetch repomd.xml via http://localhost:8081/repository/yum-proxy/7/os/x86_64/repodata/repomd.xml
- The following message will be logged
2018-01-30 10:53:43,834-0400 WARN [qtp732641399-75] admin org.sonatype.nexus.repository.yum.internal.proxy.YumProxyFacetImpl - Failed to fetch metadata file for path repodata/b686d3a0f337323e656d9387b9a76ce6808b26255fc3a138b1a87d3b1cb95ed5-primary.xml.gz and repository yum-proxy-97. Received status code 404
To fix this we need to prepend the /7/os/x86_64 part of the request url onto the url that is extracted from repomd.xml