Details
Description
Version
Sonatype Nexus Repository OSS 3.13.0-01
Component
YUM proxy repository. The proxied remote YUM repository was Centos 7 Base (http://mirror.centos.org/centos/7/os/x86_64/), however in order to simplify reproducible scenario attached steps use simple HTTP server as remote YUM repository.
Description
We encountered scenario leading to inconsistent state of metadata files of proxied YUM repository (I mean files stored in repodata directory, like repomd.xml, *primary.xml.gz, *filelists.xml.gz and so on). The inconsistency of YUM metadata files makes YUM to raise an error like:
http:/some_server/repository/test/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum
On the whole, a following situation is possible:
- All metadata yum files are consistent and all of them expired in Nexus proxy.
- YUM client requests to Nexus YUM proxy for only part of metadata files. Then, Nexus will update only part of metadata files. Let's assume that remote server didn't changed any data so metadata files are still consistent.
- All metadata yum files are consistent, however only part of them is update (didn't expired)
- All metadata was changed on YUM remote repository
- YUM client requests for all metadata files, some part of them won't be updated as they are not expired.
- Metadata yum files on YUM proxy repository are not consistent.
Reproducible steps
[user@localhost ~]$ python -m SimpleHTTPServer 12345 & [user@localhost ~]$ mkdir repo [user@localhost ~]$ # add some RPMs to repo/ directory [user@localhost ~]$ createrepo --simple-md-filenames repo [user@localhost ~]$ #add yum-proxy repository to nexus and register it as "test" in local yum [user@localhost ~]$ sudo rm -rf /var/cache/yum [user@localhost ~]$ sudo yum install --disablerepo=* --enablerepo=test fakepackagename Loaded plugins: fastestmirror Determining fastest mirrors test | 1.3 kB 00:00:00 test/primary | 841 B 00:00:00 test 5/5 No package fakepackagename available. Error: Nothing to do [user@localhost ~]$ add some more RPMs to repo/ directory [user@localhost ~]$ createrepo --simple-md-filenames repo [user@localhost ~]$ yum install --disabler=* --enabler=*test /fakepackagefilepath Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile test/filelists | 313 B 00:00:00 http://some_server/repository/test/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum Trying other mirror.