Bug 2027445

Summary: Regression in dnf updateinfo - it does not display any updates
Product: Red Hat Enterprise Linux 8 Reporter: Patrik Segedy <psegedy>
Component: dnfAssignee: amatej
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: urgent Docs Contact:
Priority: high    
Version: 8.5CC: amatej, james.antill, jcastran, jdostal, mbanas, mmraka
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.63.0-9.el8 Doc Type: No Doc Update
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Story Points: ---
Clone Of:
: 2064579 (view as bug list) Environment:
Last Closed: 2022-11-08 10:47:13 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:
Bug Depends On:    
Bug Blocks: 2064579    

Description Patrik Segedy 2021-11-29 17:08:43 UTC
Description of problem:
`dnf updateinfo info` is not showing any updates but updates are available


Version-Release number of selected component (if applicable):
dnf-0:4.4.2-11.el8.noarch
dnf-0:4.7.0-4.el8.noarch


How reproducible:
always

Steps to Reproduce:
1. have some old rpms (in my case freshly installed rhel 8.0)
2. update dnf to latest version
3. $ sudo dnf updateinfo info
Updating Subscription Management repositories.
Last metadata expiration check: 1:02:01 ago on Mon 29 Nov 2021 10:46:02 AM EST.

4. downgrade to `dnf-4.2.23-4.el8.noarch`
5. `sudo dnf updateinfo info` shows a lot of updates

Actual results:
`dnf updateinfo info` is not showing any updates but updates are available

Expected results:
`dnf updateinfo info` should show available updates

Additional info:
It is causing issues with verifying that console.redhat.com is showing correct updates and CVEs. We are pinning dnf version in our tests to dnf-4.2.23-4.el8.noarch for now.

Comment 1 amatej 2021-12-01 14:22:40 UTC
I think the problem here is that even after the update dnf has a cache that was created using an older version (older version of libsolv specifically) and it doesn't contain all the needed information.

If you simply clean the cache you should be getting the correct results.
So in your reproducer after step "2. update dnf to latest version" run: "$ sudo dnf clean metadata" and then you can "3. $ sudo dnf updateinfo info" which should show the updates correctly.

Can you verify if this helps?

Comment 2 Patrik Segedy 2021-12-01 18:42:02 UTC
It works after cleaning the cache. Thank you! 

Would it be possible to do it automatically post-update? Or can dnf recreate cache when it doesn't contain necessary information?

Comment 3 amatej 2021-12-07 08:36:06 UTC
> Would it be possible to do it automatically post-update? Or can dnf recreate
> cache when it doesn't contain necessary information?

There are some possibilities, I believe the proper solution would be to version the libsolv solv files (our cache), I have created an issue for that: https://github.com/openSUSE/libsolv/issues/481

Comment 8 amatej 2022-03-03 12:57:10 UTC
Here are PRs to fix this (they require a new version of libsolv-0.7.21-1):
libdnf: https://github.com/rpm-software-management/libdnf/pull/1441
dnf (just a unittest fix): https://github.com/rpm-software-management/dnf/pull/1816
CI test: https://github.com/rpm-software-management/ci-dnf-stack/pull/1065

Comment 14 errata-xmlrpc 2022-11-08 10:47:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libdnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7711