Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1807830

Summary: dnf and 'reposync -n' seems to behave differently to find out the latest available package
Product: Red Hat Enterprise Linux 8 Reporter: Christophe Besson <cbesson>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED DUPLICATE QA Contact: swm-qe
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: james.antill
Target Milestone: rcKeywords: Reproducer, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-04 08:39:52 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 Christophe Besson 2020-02-27 10:29:20 UTC
Description of problem:
DNF is unable to install the "latest" version of perl-DBD-SQLite from a local repository built with "reposync --newest-only".

The customer claims reposync has downloaded the following package:
perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+55ca6856.x86_64.rpm

This is consistent with the current latest package available on the customer portal:
https://access.redhat.com/downloads/content/perl-DBD-SQLite/1.58-2.module+el8.1.0+2940+55ca6856/x86_64/fd431d51/package

But DNF tries to install the following version, which has NOT been downloaded by reposync:
perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+f62455ee.x86_64.rpm

Version-Release number of selected component (if applicable):
dnf-4.2.7-6.el8.noarch
libdnf-0.35.1-8.el8.x86_64

How reproducible:
Always, but I can't confirm the reposync behavior (ENOSPC on my test system).

Steps to Reproduce:
1. reposync -n --repoid=rhel-8-for-x86_64-appstream-rpms -p /var/www/rhel8 --downloadcomps --download-metadata --delete
2. dnf install perl-DBD-SQLite

Actual results:
Error, unable to install the latest version.

Expected results:
Install the latest version.

Additional info:
From the metadata downloaded by dnf or reposync, both packages are defined in the XML file /var/cache/dnf/app-os-81b38bbd78778af0/repodata/811f116672beab186228c93547830ee3ca87c3295622e86ad9f225520ec8b9e1-primary.xml.gz
  <time build="1554189007" file="1563213372" />
  <size archive="503304" installed="498616" package="197558" />
  <location href="Packages/p/perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+f62455ee.x86_64.rpm" />

  <time build="1554188650" file="1563214121" />
  <size archive="503088" installed="498396" package="197002" />
  <location href="Packages/p/perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+55ca6856.x86_64.rpm" />

We can see perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+f62455ee has been built 357 seconds *after* perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+55ca6856.
But if we use the rpmvercmp() algorithm to compare both versions, perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+55ca6856 is considered more recent than perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+f62455ee

From packages.db which is built by DNF based on the XML metadata information, we can see that only the most recent build (according to the timestamp) has been referenced, that's why DNF tries to download or install only this one.
# strings /var/cache/dnf/packages.db | grep perl-DBD-SQLite | grep -Ev ";$|#$"
perl-DBD-SQLite-1.58-1.module+el8+2519+ab644fb0.x86_64
perl-DBD-SQLite-1.58-2.module+el8.1.0+2940+f62455ee.x86_64    <<<<<

Additionally, we can notice the package changelogs are basically the same, so it's just 2 different builds of the same source RPM, as far as I can see.

Comment 1 Jaroslav Mracek 2020-03-03 08:35:38 UTC
The issue is related or a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1775434. The path that resolves Bz1775434 change logic for downloading of latest packages from modules. Can we close the bug as a duplicate?

Comment 2 Christophe Besson 2020-03-03 09:44:43 UTC
Yes it looks like a duplicate, so this one can be closed

Comment 3 Daniel Mach 2020-03-04 08:39:52 UTC

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