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 2046581

Summary: dnf mark install raises a MarkCommand exception
Product: Red Hat Enterprise Linux 9 Reporter: Steve Baker <sbaker>
Component: dnfAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: bstinson, james.antill, jrohel, jwboyer, mbanas
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.12.0-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:15:35 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 Steve Baker 2022-01-27 01:23:52 UTC
Description of problem:

The dnf mark install command fails on a fresh rhel-9 install:

Version-Release number of selected component (if applicable):
dnf-4.10.0-2.el9.noarch as included in rhel-guest-image-9.0-20220125.3.x86_64.qcow2

How reproducible:
Every attempt to use dnf mark install

Steps to Reproduce:
1. boot a fresh rhel-guest-image-9.0-20220125.3.x86_64.qcow2
2. dnf -v -y install python3-pyyaml python3-PyYAML gettext
3. dnf mark install python3-pyyaml python3-PyYAML gettext

Actual results:
dnf mark install python3-pyyaml python3-PyYAML gettext
python3-pyyaml-5.4.1-4.el9.x86_64 marked as user installed.
python3-pyyaml-5.4.1-4.el9.x86_64 marked as user installed.
gettext-0.21-7.el9.x86_64 marked as user installed.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 201, in user_main
   errcode = main(args)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 67, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 106, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 122, in cli_run
    cli.run()
  File "/usr/lib/python3.9/site-packages/dnf/cli/cli.py", line 1055, in run
    return self.command.run()
  File "/usr/lib/python3.9/site-packages/dnf/cli/commands/mark.py", line 92, in run
    rpmdb_version = self.sack._rpmdb_version()
AttributeError: 'MarkCommand' object has no attribute 'sack'

Expected results:
Command succeeds

Additional info:
This has been fixed upstream https://github.com/rpm-software-management/dnf/commit/a33425cadf29ced8653524761bc83d4a3f303170

This bug affects the RHOSP-17.0 build pipeline since every package installed by diskimage-builder is then marked with "dnf mark install" so it is not currently possible to build an overcloud image.

Comment 5 Jaroslav Mracek 2022-03-15 14:32:58 UTC
The issue is already fixed (2X) in upstream.

Comment 13 errata-xmlrpc 2022-11-15 11:15: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 (dnf 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:8297