Bug 1776410

Summary: Package "X" from local repository "Y" has incorrect checksum . Reposync does not transfer all RPMs.
Product: Red Hat Enterprise Linux 8 Reporter: Justin Pierce <jupierce>
Component: dnf-plugins-coreAssignee: Marek Blaha <mblaha>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: high    
Version: 8.1CC: amatej, bfournie, dmach, james.antill, mblaha, rpittau
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-09 11:36:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Pierce 2019-11-25 16:15:20 UTC
Description of problem:
After a reposync of rhel-8 baseos & appstream repositories, I am still unable to install mariadb due to missing files/checksum errors.



Version-Release number of selected component (if applicable):
4.2.7
  Installed: dnf-0:4.2.7-7.el8_1.noarch at Tue Oct 29 16:41:41 2019
  Built    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Mon Oct 21 12:28:04 2019

  Installed: rpm-0:4.14.2-25.el8.x86_64 at Tue Oct 29 16:41:36 2019
  Built    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Wed Aug  7 13:32:37 2019



How reproducible:
100%

Steps to Reproduce:
1. Run a rhel8 ubi image
2. Reposync the pulp.dist baseos & appstream rhel-8 repositories
3. Attempt to use those repositories to install mariadb

Actual results:
Error opening file for checksum: /4.2/rhel-8-appstream-rpms/rhel-8-appstream-rpms/Packages/p/perl-IO-Socket-IP-0.39-5.el8.noarch.rpm
Package "perl-IO-Socket-IP-0.39-5.el8.noarch" from local repository "rhel-8-appstream-rpms" has incorrect checksum
Error opening file for checksum: /4.2/rhel-8-appstream-rpms/rhel-8-appstream-rpms/Packages/p/perl-libnet-3.11-3.el8.noarch.rpm
Package "perl-libnet-3.11-3.el8.noarch" from local repository "rhel-8-appstream-rpms" has incorrect checksum
Error opening file for checksum: /4.2/rhel-8-appstream-rpms/rhel-8-appstream-rpms/Packages/p/perl-Digest-1.17-395.el8.noarch.rpm
Package "perl-Digest-1.17-395.el8.noarch" from local repository "rhel-8-appstream-rpms" has incorrect checksum
Error opening file for checksum: /4.2/rhel-8-appstream-rpms/rhel-8-appstream-rpms/Packages/p/perl-Digest-MD5-2.55-396.el8.x86_64.rpm
Package "perl-Digest-MD5-2.55-396.el8.x86_64" from local repository "rhel-8-appstream-rpms" has incorrect checksum
Error: Some packages from local repository have incorrect checksum


Expected results:
All RPMs & modules should be intact in the local repositories.


Additional info:
Detailed steps:

host$ mkdir artifacts
host$ mkdir 4.2
# Run a ubi image 

host$ sudo podman run -it --rm -v $PWD/artifacts:/artifacts:Z -v $PWD/4.2:/4.2:Z registry.access.redhat.com/ubi8/ubi@sha256:a7209baef64d9a6e8e87cbc2a6f27d402a04cd3750006f1338a2924b4bf585f7 /bin/sh

# reposync baseos  (yum.conf attached to this BZ)
ubi$ dnf -v reposync --download-metadata --setopt=module_platform_id="platform:el8" -c /artifacts/yum.conf -p /4.2/rhel-8-baseos-rpms --delete --arch noarch --arch x86_64 -n --repo rhel-8-baseos-rpms --downloadcomps | tee reposync.1.log

# reposync appstream (yum.conf attached to this BZ)
ubi$ dnf -v reposync --download-metadata --setopt=module_platform_id="platform:el8" -c /artifacts/yum.conf -p /4.2/rhel-8-appstream-rpms --delete --arch noarch --arch x86_64 -n --repo rhel-8-appstream-rpms --downloadcomps | tee reposync.2.log

# Overwrite system yum.conf with yum.install.conf from this BZ
ubi$ cp /artifacts/yum.install.conf /etc/yum.conf

# Installing python36 works great (see attached log)
ubi$ dnf install python36

# Installing mariadb fails (see attached log)
ubi$ dnf install mariadb

Comment 2 Marek Blaha 2019-12-09 11:36:11 UTC
This is actually a duplicate of the https://bugzilla.redhat.com/show_bug.cgi?id=1775434 bug. The problem is that `dnf reposync --newest-only` is broken with modular repositories.
As a workaround (until the patched version is released) you can drop `-n` option when syncing the appstream repository - at the cost of several gigabytes of storage space.
I tried your use case with patched reposync (https://github.com/rpm-software-management/dnf-plugins-core/pull/375) and I can confirm that the patched version works well and mariadb is installable.

If you disagree with closing this bug as a duplicate, please do not hesitate to reopen it.

*** This bug has been marked as a duplicate of bug 1775434 ***