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.
Description of problem:
When using 'DNF_VAR_*' environment variables in dnf repo configs, substitution worked fine in 8.1.1911, but in 8.2.2004 does not.
Version-Release number of selected component (if applicable):
dnf-4.2.17-6.el8.noarch
How reproducible:
Always.
Steps to Reproduce:
1. Define dnf repo configs using 'DNF_VAR_*' variables
2. Export variables
3. Try to use dnf on affected repo
Actual results:
dnf-4.2.17-6.el8
Example repo config:
[BaseOS-upstream]
name = CentOS $DNF_VAR_REL $DNF_VAR_ARCH (BaseOS)
baseurl = http://mirror.sesp.northwestern.edu/centos/$DNF_VAR_REL/BaseOS/$DNF_VAR_ARCH/os/
gpgcheck = 1
#gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official
enabled = 1
Example repolist output illustrating lack of substitution:
$ DNF_VAR_REL=8 DNF_VAR_ARCH=x86_64 dnf -c /etc/dnf.mirrors.conf repolist
repo id repo name
BaseOS-upstream CentOS $DNF_VAR_REL $DNF_VAR_ARCH (BaseOS)
Expected results:
Note, same host as above example, with dnf downgraded to dnf-4.2.7-7.el8_1 from the 8.1 repo.
$ DNF_VAR_REL=8 DNF_VAR_ARCH=x86_64 dnf -c /etc/dnf.mirrors.conf repolist
Last metadata expiration check: 0:23:04 ago on Wed 17 Jun 2020 07:53:48 PM UTC.
repo id repo name status
BaseOS-upstream CentOS 8 x86_64 (BaseOS) 1,675
Additional info:
Easy to replicate by simply upgrading/downgrading the version of dnf.
I can confirm that it's reproducible.
IIRC the intent was to use DNF_VAR_ prefix in the variable name in the shell
to avoid any collisions with other variable names.
The prefix is stripped in DNF now.
Following config should work:
[BaseOS-upstream]
name = CentOS $REL $ARCH (BaseOS)
baseurl = http://mirror.sesp.northwestern.edu/centos/$DNF_VAR_REL/BaseOS/$ARCH/os/
gpgcheck = 1
#gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official
enabled = 1
We should definitely document this behavior properly in dnf(8).
We should also review how existing variables are set.
I'd expect setting DNF_VAR_releasever=foo DNF_VAR_basearch=bar to work,
but it doesn't.
Confirmed that stripping the DNF_VAR_ prefix from my repo configs did fix the problem - thank you! I do agree that this is just a documentation problem at this point. When I noticed the issue, the first thing I did was check the docs to see if anything changed, and it showed nothing.
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 (yum 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/RHEA-2020:4510