Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-19298

Nexus Repository generated yum metadata doesn't match mirror.centos.org

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.15.1
    • Fix Version/s: None
    • Component/s: Yum
    • Labels:
      None

      Description

      We have a team using Nexus to mirror an upstream centos yum repository (using a proxy style repo is not an option because they need complete control over the rpms). After synching a number of repos, including http://mirror.centos.org/centos/7.6.1810/os/ and http://mirror.centos.org/centos/7.6.1810/updates/, the directory structure in Nexus is as follows:

      - pc-3.10
         - centos
            - 7.6.1810
               + debuginfo
               + epel
               + extras
               - os
                  - x86_64
                     + Packages
                     + repodata
               + storage-ceph-jewel
               + thirdparty
               - updates
                  - x86_64
                     + Packages
                     + repodata
      

      The repodata depth is set to 5. We've setup a single test repo on a test machine:

      # cat /etc/yum.repos.d/test.repo 
      [CentOS-OS]
      name=CentOS OS mirror
      baseurl=https://nexus.internal.site.com/repository/pc-yum-centos/pc-3.1.0/centos/7.6.1810/os/x86_64/
      #baseurl=http://mirror.centos.org/centos/7.6.1810/os/x86_64/
      gpgcheck=1
      enabled=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
      
      [CentOS-Updates]
      name=CentOS Updates mirror
      baseurl=https://nexus.internal.site.com/repository/pc-yum-centos/pc-3.1.0/centos/7.6.1810/updates/x86_64/
      #baseurl=http://mirror.centos.org/centos/7.6.1810/updates/x86_64/
      gpgcheck=1
      enabled=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
      

      We then attempt to install the perl-Test-Harness package. With the baseurls pointed to the centos mirror the package dependencies resolve correctly and yum install everything just fine. If we then flip the baseurls to point to our Nexus instance (as in the snippet above) we receive the following error:

      # yum install perl-Test-Harness
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
      CentOS-OS                                                                                                                                        | 1.5 kB  00:00:00     
      CentOS-Updates                                                                                                                                   | 1.5 kB  00:00:00     
      (1/2): CentOS-Updates/primary                                                                                                                    | 1.2 MB  00:00:01     
      (2/2): CentOS-OS/primary                                                                                                                         | 2.9 MB  00:00:02     
      CentOS-OS                                                                                                                                                   10018/10018
      CentOS-Updates                                                                                                                                                1067/1067
      Resolving Dependencies
      --> Running transaction check
      ---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
      --> Processing Dependency: perl >= 5.00405 for package: perl-Test-Harness-3.28-3.el7.noarch
      --> Finished Dependency Resolution
      Error: Package: perl-Test-Harness-3.28-3.el7.noarch (CentOS-OS)
                 Requires: perl >= 5.00405
                 Installed: 4:perl-5.16.3-294.el7_6.x86_64 (@updates)
                     perl = 4:5.16.3-294.el7_6
                 Available: 4:perl-5.16.3-293.el7.x86_64 (CentOS-OS)
                     perl = 5.16.3-293.el7
      

      Looking at the error (running the command with a higher level of output confirms) that the epoch is missing from some metadata somewhere. Looking through the rpms and metadata reveals that the primary.xml file generated by Nexus doesn't match what's upstream (everything else is consistent). Specifically the requires section for perl-Test-Harness:

      From Nexus
            <rpm:requires>
              <rpm:entry name="/usr/bin/perl"/>
              <rpm:entry ver="5.00405" name="perl" flags="GE"/>
              <rpm:entry name="perl(:MODULE_COMPAT_5.16.3)"/>
              <rpm:entry name="perl(App::Prove)"/>
              <rpm:entry name="perl(App::Prove::State)"/>
              <rpm:entry name="perl(App::Prove::State::Result)"/>
              <rpm:entry name="perl(App::Prove::State::Result::Test)"/>
              <rpm:entry name="perl(Benchmark)"/>
              <rpm:entry name="perl(Carp)"/>
              <rpm:entry name="perl(Config)"/>
              <rpm:entry name="perl(Exporter)"/>
              <rpm:entry name="perl(File::Basename)"/>
              <rpm:entry name="perl(File::Find)"/>
              <rpm:entry name="perl(File::Path)"/>
              <rpm:entry name="perl(File::Spec)"/>
              <rpm:entry name="perl(Getopt::Long)"/>
              <rpm:entry name="perl(IO::Handle)"/>
              <rpm:entry name="perl(IO::Select)"/>
              <rpm:entry name="perl(POSIX)"/>
              <rpm:entry name="perl(TAP::Base)"/>
              <rpm:entry name="perl(TAP::Formatter::Base)"/>
              <rpm:entry name="perl(TAP::Formatter::Console::Session)"/>
              <rpm:entry name="perl(TAP::Formatter::File::Session)"/>
              <rpm:entry name="perl(TAP::Formatter::Session)"/>
              <rpm:entry name="perl(TAP::Harness)"/>
              <rpm:entry name="perl(TAP::Object)"/>
              <rpm:entry name="perl(TAP::Parser::Aggregator)"/>
              <rpm:entry name="perl(TAP::Parser::Grammar)"/>
              <rpm:entry name="perl(TAP::Parser::Iterator)"/>
              <rpm:entry name="perl(TAP::Parser::Iterator::Array)"/>
              <rpm:entry name="perl(TAP::Parser::Iterator::Process)"/>
              <rpm:entry name="perl(TAP::Parser::Iterator::Stream)"/>
              <rpm:entry name="perl(TAP::Parser::IteratorFactory)"/>
              <rpm:entry name="perl(TAP::Parser::Result)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Bailout)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Comment)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Plan)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Pragma)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Test)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Unknown)"/>
              <rpm:entry name="perl(TAP::Parser::Result::Version)"/>
              <rpm:entry name="perl(TAP::Parser::Result::YAML)"/>
              <rpm:entry name="perl(TAP::Parser::ResultFactory)"/>
              <rpm:entry name="perl(TAP::Parser::Scheduler::Job)"/>
              <rpm:entry name="perl(TAP::Parser::Scheduler::Spinner)"/>
              <rpm:entry name="perl(TAP::Parser::Source)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler::Executable)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler::File)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler::Handle)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler::Perl)"/>
              <rpm:entry name="perl(TAP::Parser::SourceHandler::RawTAP)"/>
              <rpm:entry name="perl(TAP::Parser::Utils)"/>
              <rpm:entry name="perl(TAP::Parser::YAMLish::Reader)"/>
              <rpm:entry name="perl(TAP::Parser::YAMLish::Writer)"/>
              <rpm:entry name="perl(constant)"/>
              <rpm:entry name="perl(strict)"/>
              <rpm:entry name="perl(vars)"/>
            </rpm:requires>
      
      From mirror.centos
            <rpm:requires>
              <rpm:entry name="/usr/bin/perl"/>
              <rpm:entry name="perl" flags="GE" epoch="0" ver="5.00405"/>
              <rpm:entry name="perl(:MODULE_COMPAT_5.16.3)"/>
              <rpm:entry name="perl(Benchmark)"/>
              <rpm:entry name="perl(Carp)"/>
              <rpm:entry name="perl(Config)"/>
              <rpm:entry name="perl(Exporter)"/>
              <rpm:entry name="perl(File::Basename)"/>
              <rpm:entry name="perl(File::Find)"/>
              <rpm:entry name="perl(File::Path)"/>
              <rpm:entry name="perl(File::Spec)"/>
              <rpm:entry name="perl(Getopt::Long)"/>
              <rpm:entry name="perl(IO::Handle)"/>
              <rpm:entry name="perl(IO::Select)"/>
              <rpm:entry name="perl(POSIX)"/>
              <rpm:entry name="perl(constant)"/>
              <rpm:entry name="perl(strict)"/>
              <rpm:entry name="perl(vars)"/>
            </rpm:requires>
      

      I was able to reproduce these results by putting the rpm in question in its own directory and running createrepo which results in metadata that matches the centos mirror. I then put the rpm into it's own Nexus hosted yum repo, and the metadata matches what we're seeing in the other Nexus repo.

      The rpm is available at http://mirror.centos.org/centos/7.6.1810/os/x86_64/Packages/perl-Test-Harness-3.28-3.el7.noarch.rpm. I tried attaching the file here, as well as some of the metadata files, but getting a token missing error from Jira. Here's the sha256:

      3414c239f0b991dad77b3b6652e1a5f6c54d0931ad69fbe4286223e34c6b1a40  perl-Test-Harness-3.28-3.el7.noarch.rpm
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              flevesqu Francis Levesque
              Last Updated By:
              Joe Tom Joe Tom
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title