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 1947924 - python3-dnf uses Recommends for python3-unbound and rpm-plugin-systemd-inhibit
Summary: python3-dnf uses Recommends for python3-unbound and rpm-plugin-systemd-inhibit
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: dnf
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: beta
: ---
Assignee: Pavla Kratochvilova
QA Contact: Tomáš Bajer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-09 14:20 UTC by Jan Pazdziora
Modified: 2022-05-17 16:22 UTC (History)
6 users (show)

Fixed In Version: dnf-4.10.0-3.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 15:55:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:3957 0 None None None 2022-05-17 15:55:12 UTC

Description Jan Pazdziora 2021-04-09 14:20:48 UTC
Description of problem:

RHEL 9 Content Structure and Guidelines state that weak dependencies in BaseOS are allowed, but discouraged.

By using the Recommends weak dependencies especially for packages in @core group (Minimal host installation) or their direct dependencies, the recommended package gets pulled into the installed package set depending on the current configuration of the dnf transaction.

The python3-dnf package Recommends python3-unbound and rpm-plugin-systemd-inhibit.

If those packages are needed by python3-dnf for correct operation, Requires should be used.

If python3-unbound and rpm-plugin-systemd-inhibit are essential in minimal host installations, they should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having python3-dnf in @core dependencies.

If they are listed primarily for convenience, Suggests might be better option. Or just drop the weak dependency completely.

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

python3-dnf-4.6.0-1.el9.noarch

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf remove -y python3-unbound rpm-plugin-systemd-inhibit
2. dnf reinstall -y python3-dnf

Actual results:

================================================================================
 Package                     Arch    Version            Repository         Size
================================================================================
Reinstalling:
 python3-dnf                 noarch  4.6.0-1.el9        beaker-BaseOS     415 k
Installing dependencies:
 libevent                    x86_64  2.1.12-3.el9       beaker-BaseOS     270 k
 protobuf-c                  x86_64  1.3.3-6.el9        beaker-AppStream   36 k
 unbound-libs                x86_64  1.13.1-1.el9       beaker-AppStream  528 k
Installing weak dependencies:
 python3-unbound             x86_64  1.13.1-1.el9       beaker-AppStream  102 k
 rpm-plugin-systemd-inhibit  x86_64  4.16.1.3-1.el9     beaker-AppStream   24 k

Expected results:

Only python3-dnf reinstalled.

Additional info:

Comment 3 Jaroslav Mracek 2021-10-14 09:07:55 UTC
I checked dnf code for usage of unbound. It used in dnssec.py for gpgkey_dns_verification. The feature is optional and enabled by configuration option gpgkey_dns_verification. DNF requires python3-unbound only when gpgkey_dns_verification is True.

```
    @staticmethod
    def _cache_miss(input_key):
        # type: (KeyInfo) -> Validity
        """
        In case the key was not found in the cache, create an Unbound context and contact the DNS
        system
        """
        try:
            import unbound
        except ImportError as e:
            msg = _("Configuration option 'gpgkey_dns_verification' requires "
                    "python3-unbound ({})".format(e))
            raise dnf.exceptions.Error(msg)
```

I am not sure what would be the best approach to resolve it. Any suggestion?

Comment 4 Jan Pazdziora 2021-10-14 13:13:06 UTC
It's true that Red Hat publishes the GPG keys used for signing rpms in DNS

$ cat /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
$ dig 5d2d3ceb7abe552344276d47d36a8175b7aeb250a9bf0bf00e850cd2._openpgpkey.redhat.com OPENPGPKEY

so the option gpgkey_dns_verification could be used to verify import of those keys. However, the gpgkey_dns_verification functionality depends on DNSSEC and redhat.com does not use DNSSEC:

$ dig +dnssec 5d2d3ceb7abe552344276d47d36a8175b7aeb250a9bf0bf00e850cd2._openpgpkey.redhat.com OPENPGPKEY | grep RRSIG

(yes, the ad flag should also be checked -- it's not there either :-)

I assume that is why that option is not enabled by default in default RHEL installation because it would not work for any of Red Hat's official rpms.

Granted, the customer could use that option for their own repositories and packages ... but if they configure that, they can just as well add python3-unbound to their kickstarts or rpm --import their keys in their kickstarts to make the setup work.

For that reason I would not consider the dependency on python3-unbound to be critical at this point.

Comment 8 Pavla Kratochvilova 2021-11-05 06:42:34 UTC
The dependency on deltarpm is already removed in RHEL 9.

We can remove the dependency on python3-unbound based on comment 3, comment 4 and comment 5.

As for the rpm-plugin-systemd-inhibit, I believe this is actually a valid use case of the "Recommends". It is not strictly required, since dnf can work without it, but we want to have it installed by default, because it's important for preventing transaction interruption (see bug 1109927). How about turning the dependency into "Recommends: (rpm-plugin-systemd-inhibit if systemd)"? Then at least the dependency wouldn't get pulled in on systems without systemd.

Comment 9 Jan Pazdziora 2021-11-10 21:35:05 UTC
The "Recommends: (rpm-plugin-systemd-inhibit if systemd)" seems sound ... but why wouldn't we want to do "Requires: (rpm-plugin-systemd-inhibit if systemd)"?

Comment 10 Pavla Kratochvilova 2021-11-29 09:06:03 UTC
(In reply to Jan Pazdziora from comment #9)
> The "Recommends: (rpm-plugin-systemd-inhibit if systemd)" seems sound ...
> but why wouldn't we want to do "Requires: (rpm-plugin-systemd-inhibit if
> systemd)"?

Because it would be an unnecessary restriction, since dnf can function without the plugin.

Comment 11 Pavla Kratochvilova 2021-12-15 12:14:01 UTC
PR: https://github.com/rpm-software-management/dnf/pull/1798

Comment 20 errata-xmlrpc 2022-05-17 15:55:05 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 (new packages: dnf), 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:3957


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