Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 2112726

Summary: Patching via katello-agent fails with error KeyError: <libdnf.transaction.TransactionItem; proxy of <Swig Object of type 'libdnf::TransactionItemPtr *' at 0x7f34aeff0b10> >
Product: Red Hat Satellite Reporter: matt jia <mjia>
Component: katello-agentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.9.9CC: ahumbe, bbuckingham, dsinglet, iballou, jyejare, lufu, mkushwah, nikhjain, paji, saydas, wclark, yoliynyk
Target Milestone: UnspecifiedKeywords: PrioBumpGSS, Triaged
Target Release: Unused   
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: 2023-04-26 13:52:27 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 matt jia 2022-08-01 00:40:00 UTC
Description of problem:

When patching a RHEL8 host, goferd has tracebacks:


Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - Handler failed.
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - Traceback (most recent call last):
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/dispatcher.py", line 78, in install
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     _report = handler.install(units, dict(options))
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/handler.py", line 274, in install
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     details = package.update(advisories=advisories)
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/libdnf.py", line 266, in update
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     report = UpdateTxReport(lib.transaction or ())
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/libdnf.py", line 119, in __init__
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     po = item.pkg
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/dnf/db/history.py", line 157, in pkg
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     return self._swdb.rpm._swdb_ti_pkg[self._item]
Jul 27 17:14:32 KRMLTEST01 goferd[12442]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - KeyError: <libdnf.transaction.TransactionItem; proxy of <Swig Object of type 'libdnf::TransactionItemPtr *' at 0x7f34aeff0b10> >

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

katello-agent-3.5.4-1
katello-host-tools-3.5.4-1

How reproducible:

only in the customer's environment


Additional info:

Comment 11 Sayan Das 2022-11-17 18:25:59 UTC
I have added a private attachment on the case showing the entire gofer activity on the client system. ( It was being done on an RHEL 8.6 having katello-agent-3.5.4-1.el8sat.noarch \ gofer-2.12.5-7.el8sat.noarch installed )

It seems like, 

** User selects a few installable ERRATAs for a host in Satellite UI and initiates a Katello-Agent based job from Satellite to apply on the target host.

** gofer receives the task\message and proceeds with 

   * downloading repodata
   * downloading the required packages associated with the targetted ERRATAs in the dnf cache
   * Installs\Upgrades them on the system
   * Removes the cached packages from dnf cache.


** So far all looks good but then it tries to do something with "katello.agent.pulp.dispatcher" and that's where the traceback is 

~~
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - Handler failed.
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - Traceback (most recent call last):
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/dispatcher.py", line 78, in install
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     _report = handler.install(units, dict(options))
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/handler.py", line 274, in install
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     details = package.update(advisories=advisories)
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/libdnf.py", line 266, in update
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     report = UpdateTxReport(lib.transaction or ())
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/katello/agent/pulp/libdnf.py", line 119, in __init__
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     po = item.pkg
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -   File "/usr/lib/python3.6/site-packages/dnf/db/history.py", line 157, in pkg
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 -     return self._swdb.rpm._swdb_ti_pkg[self._item]
Nov 11 08:13:33 satellite goferd[4076429]: [ERROR][worker-0] katello.agent.pulp.dispatcher:82 - KeyError: <libdnf.transaction.TransactionItem; proxy of <Swig Object of type 'libdnf::TransactionItemPtr *' at 0x7fef0fbd6a20> >
~~

And this is the same trace returned to the satellite saying the task failed whereas it actually succeeds in doing 95% of the entire thing but then fails to perform something specific at the very end. 

Perhaps it was trying to collect the updated package data or advisory information related to them ?

Any idea what it fails to do here exactly ?

Comment 18 Sayan Das 2023-04-26 07:20:07 UTC
JFYI, The end-user confirmed that The issue was fixed once they upgraded to Satellite 6.10

Comment 19 Lucy Fu 2023-04-26 13:52:27 UTC

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

Comment 20 Red Hat Bugzilla 2023-09-18 04:43:26 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days