Bug 1847124
Summary: | Packagekit console client cannot refresh repo data due to undefined repo vars | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Neal Gompa <ngompa13> | ||||||
Component: | PackageKit | Assignee: | Richard Hughes <rhughes> | ||||||
Status: | CLOSED WONTFIX | QA Contact: | Desktop QE <desktop-qa-list> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | CentOS Stream | CC: | bmilar, bstinson, carl, darrin, davide, juanje, klember, rhughes, riehecky, sbarcomb, tpelka | ||||||
Target Milestone: | rc | Keywords: | Triaged | ||||||
Target Release: | 8.4 | ||||||||
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: | 2021-12-15 07:27:12 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: | |||||||||
Attachments: |
|
Description
Neal Gompa
2020-06-15 18:02:51 UTC
Note: I manually cloned this from the CentOS MantisBT (linked as an external bug) so that it can be properly tracked, and added information about the fix to make this easier to resolve. I've submitted this as a pull request to CentOS Stream: https://git.centos.org/rpms/PackageKit/pull-request/1 Created attachment 1700492 [details]
Backport fix to make dnf vars load properly
I've attached Neal's pull request here in patch form. Because CentOS is still using the rpmbuild layout (SPECS and SOURCES directories), you'll need to use `patch -p2` to apply it to a flat tree (i.e. RHEL's dist-git).
"git am -p2" will also work using the commit straight from the PR. :) Could you please provide the repo file which caused the trouble, so I can test it on RHEL? Created attachment 1718445 [details] CentOS-Base.repo file (In reply to Bohdan Milar from comment #7) > Could you please provide the repo file which caused the trouble, so I can > test it on RHEL? I've attached one of the CentOS repo files that demonstrates the issue. Thanks for the repo file. Not having the gpgkey, I have disabled gpgcheck. Using the repo file in this form... ---- [BaseOS] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra #baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/ gpgcheck=0 enabled=1 ---- ... I got no error. Everything seemed to work. I had to disable the mirrorlist line and enable "baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/" to reproduce the behavior. Then I got: ---- Fatal error: cannot update repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 404 for http://mirror.centos.org/$contentdir/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 109.228.54.129) ---- So it correctly replaced $releasever with 8 and $basearch with x86_64. The only unrecognized variable was $contentdir. But the same problem appears when using dnf: ---- $ dnf upgrade ... CentOS-8 - Base 27 kB/s | 7.6 kB 00:00 Errors during downloading metadata for repository 'BaseOS': - Status code: 404 for http://mirror.centos.org/$contentdir/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 109.228.54.129) Error: Failed to download metadata for repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried ---- So I am not sure, whether it is a PackageKit bug. > So I am not sure, whether it is a PackageKit bug.
You need to have the dnf vars set up for DNF to work. Create /etc/dnf/vars/contentdir with the value of "centos".
To be clear, the bug is that PackageKit doesn't read the vars set in /etc/dnf/vars. All the internally set ones work in PackageKit now ($releasever, $basearch). OK, thanks. So I used this reproducer: 1. echo "centos" >> /etc/dnf/vars/contentdir 2. cat > /etc/yum.repos.d/CentOS-Base.repo << EOF [BaseOS] name=CentOS-$releasever - Base baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/ gpgcheck=0 enabled=1 EOF 3. pkcon refresh force Result: Fatal error: cannot update repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 404 for http://mirror.centos.org/$contentdir/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 62.141.54.220) Additional info: - PackageKit-1.1.12-6.el8.x86_64 - 'dnf --refresh check-upgrade' works fine. Hey, has anyone had a chance to look and act on this? I provided a patch, a test case, and it seems to be verified as an issue. So can we get this fix landed for RHEL 8.4? I think this needs to go into centos stream first, no? Yes it does, which is why I filed this bug report, provided a patch, and offered a test case so that it could land in CentOS Stream and make it in for RHEL 8.4. But now that RHEL 8.4 is in Beta, it'll probably slip and go into RHEL 8.5, assuming anything actually happens anytime soon... *sigh* Ping? Can someone please look at this to get it fixed in RHEL 8.5? Friendly ping again? I'd *really* like this to land for RHEL 8.5... I've gone ahead and backported this myself for the CentOS Hyperscale Workstation since PackageKit being completely broken is unacceptable for our spin. You can see the backport here: https://git.centos.org/rpms/PackageKit/c/ccbcd8ce4ec42d7d5d599d46cb32e95d2e627910?branch=c8s-sig-hyperscale After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. |