Bug 1782352 - [RHEL 8.1 client] All packages are not getting updated after click on "Update All Packages"
Summary: [RHEL 8.1 client] All packages are not getting updated after click on "Update...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.6.0
Hardware: x86_64
OS: Linux
unspecified
high vote
Target Milestone: 6.8.0
Assignee: Partha Aji
QA Contact: Gaurav Talreja
URL:
Whiteboard:
: 1805059 1824909 1829866 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-11 14:28 UTC by Michal Dekan
Modified: 2021-07-28 08:31 UTC (History)
10 users (show)

Fixed In Version: katello-host-tools-3.5.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1862242 (view as bug list)
Environment:
Last Closed: 2020-10-27 12:59:35 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28909 0 Normal Closed [RHEL 8.1 client - libdnf] All packages are not getting updated after click on "Update All Packages" 2021-02-18 05:26:38 UTC
Red Hat Knowledge Base (Solution) 4653531 0 None None None 2019-12-12 11:46:22 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:59:51 UTC

Description Michal Dekan 2019-12-11 14:28:06 UTC
Description of problem:

Have a RHEL 8.1 client registered to Satellite 6.6, go to Hosts => Content Hosts => select RHEL 8.1 client => tab Packages, choose Applicable and click on "Update All Packages"

First run: 7 packages out of 25 got updated, foreman task  Actions::Katello::Host::Package::Update finished successfully.

Package profile for the client didn't get updated, still see 25 Applicable packages, yum check-update is showing 18 available updates.

Second run: Clicked on "Update All Packages", foreman task Actions::Katello::Host::Package::Update finished successfully again, very quickly, looks like nothing was updated on the client at all. yum check-update returns again 18 available updates.

Checking which message is sent to katello-agent:

 while true; do cp /var/lib/gofer/messaging/pending/katello/* tmp; sleep 0.0001; done

And then click on Update All Packages, got following file, during second run:

# cat 1576069770-369455-0000.json | json_reformat
{
    "data": {
        "consumer_id": "a16dae10-1a86-4feb-95b6-762915d199cb",
        "task_id": "7dea4867-54db-4005-8064-3ddfda435680"
    },
    "pam": null,
    "replyto": "pulp.task",
    "request": {
        "args": [
            [
                {
                    "type_id": "rpm",
                    "unit_key": {

                    }
                }
            ],
            {
                "all": true,
                "importkeys": true
            }
        ],
        "classname": "Content",
        "cntr": [
            [

            ],
            {

            }
        ],
        "kws": {

        },
        "method": "update"
    },
    "routing": [
        null,
        "pulp.agent.a16dae10-1a86-4feb-95b6-762915d199cb"
    ],
    "secret": "5df0cca51ca0521f66db0567",
    "sn": "2e5026a8-e8a4-4a78-b812-ebf79c07f5f8",
    "version": "2.0"
}


Version-Release number of selected component (if applicable):

# rpm -qa | egrep "katello-agent|dnf"
dnf-data-4.2.7-6.el8.noarch
dnf-plugin-subscription-manager-1.25.17-1.el8.x86_64
python3-libdnf-0.35.1-8.el8.x86_64
python3-dnf-4.2.7-6.el8.noarch
python3-dnf-plugins-core-4.0.8-3.el8.noarch
dnf-plugins-core-4.0.8-3.el8.noarch
libdnf-0.35.1-8.el8.x86_64
dnf-4.2.7-6.el8.noarch
katello-agent-3.5.1-2.el8sat.noarch



How reproducible: 100 %


Steps to Reproduce:
1. Provisioned RHEL 8.1 trough Satellite 6.6
2. Clock on Update All Packages, task finished successfully, however only 7 packages out of 25 got updated and package profile for the client did not get updated on Satellite side, task Actions::Katello::Host::UploadProfiles finished sucessfully 
3.

Actual results:

First run of Update All Packages on RHEL 8.1 client updated only 7 packages out of 25, package profile on Satellite didn't get updated. Second run of Update All Packages didn't update any package.

Expected results:

"Update All Packages" updates all packages on RHEL 8.1 :)

Comment 5 Pavel Moravec 2019-12-12 12:02:24 UTC
I think https://bugzilla.redhat.com/show_bug.cgi?id=1713417 fixed just "errata install" scenario but the bugfix should be extended to cover this call flow as well.

Checking codefix of bz1713417 : https://github.com/Katello/katello-host-tools/pull/98/files makes a different condition to call

lib.upgrade(patterns)

But in case of "Update All Packages", both patterns and advisories are empty lists. Removing the "if patterns:" condition and letting lib.upgrade(patterns) to be executed every time, packages are updated.

But I am not 100% sure if this cant break something - what is the expected behaviour of the "update" method called on empty lists?
- to update nothing? (then katello should enumerate all packages to update in the RMI request / enumerate the unit_keys)
- or update everything? (then my patch proposal is sane)

Requesting review of the author of the original patch.

Comment 6 Partha Aji 2020-02-01 06:39:44 UTC
Connecting redmine issue https://projects.theforeman.org/issues/28909 from this bug

Comment 7 Bryan Kearney 2020-02-01 07:03:11 UTC
Upstream bug assigned to paji@redhat.com

Comment 8 Bryan Kearney 2020-02-01 07:03:13 UTC
Upstream bug assigned to paji@redhat.com

Comment 9 Bryan Kearney 2020-02-04 21:03:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28909 has been resolved.

Comment 10 Brad Buckingham 2020-02-12 19:20:25 UTC
Clearing the needinfo, since a patch was submitted/merged upstream.

Comment 11 Brad Buckingham 2020-03-02 17:43:00 UTC
*** Bug 1805059 has been marked as a duplicate of this bug. ***

Comment 12 Brad Buckingham 2020-04-26 21:11:36 UTC
*** Bug 1824909 has been marked as a duplicate of this bug. ***

Comment 13 Jonathon Turel 2020-05-14 20:49:06 UTC
*** Bug 1829866 has been marked as a duplicate of this bug. ***

Comment 14 Radovan Drazny 2020-07-16 12:23:59 UTC
Tested on Satellite 6.8 Snap 8 using the reproducer from the initial report. Registered a RHEL 8.1 content host and executed "Update All Packages" on the "Packages->Applicable" page. All packages were successfully updated. The "Actions::Katello::Host::UploadProfiles" task was performed successfully, no more packages to update were listed.

Comment 17 errata-xmlrpc 2020-10-27 12:59:35 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 (Important: Satellite 6.8 release), 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/RHSA-2020:4366


Note You need to log in before you can comment on or make changes to this bug.