Bug 1767345
| Summary: | gnome-software fails to download repodata when repo is configured with custom variable in /etc/dnf/vars (/etc/yum/vars/) | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Denis Volkov <dvolkov> |
| Component: | dnf | Assignee: | Jaroslav Rohel <jrohel> |
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.0 | CC: | dmach, james.antill, jrohel, klember, mkrajnak, tpelka |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-11-18 08:32:39 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
Denis Volkov
2019-10-31 08:50:29 UTC
Hello Denis, can you please confirm that the repositories and variables are working for you when you use them via either dnf, yum or pkcon ? For example: # dnf install <pkg> # pkcon install <pkg> does "# dnf update" show any errors for you ? Thanks in advance. Hello Sorry, for missing info - yes, dnf/yum works ok. # dnf clean all Updating Subscription Management repositories. 24 files removed [root@test ~]# dnf check-update Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 2.3 MB/s | 9.4 MB 00:04 Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 2.7 MB/s | 8.1 MB 00:02 Last metadata expiration check: 0:00:01 ago on Fri 01 Nov 2019 11:19:48 CET. Security: kernel-core-4.18.0-80.11.2.el8_0.x86_64 is an installed security update Security: kernel-core-4.18.0-80.1.2.el8_0.x86_64 is the currently running version `dnf install` also installs packages without a problem. OK, I couldn't reproduce yesterday, today I am getting the same error, adding my reproducer for convenience: Packages: gnome-software-3.30.6-2.el8.x86_64 dnf-4.2.7-6.el8.noarch Reproducer: 1. Setup subscription 2. Replacing strings generated by subscription manager to use variables: so I have for all urls, even the disabled: baseurl = https://cdn.stage.redhat.com/content/beta/$releasever/$osarch/appstream/os 3. adding vars [root@localhost ~]# echo 'x86_64' > /etc/dnf/vars/osarch [root@localhost ~]# echo 'rhel8/8' > /etc/dnf/vars/releasever 4. Verifying repositories [root@localhost ~]# dnf -y update Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 1.0 MB/s | 10 MB 00:10 Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs) 1.7 MB/s | 6.7 MB 00:03 Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 5.8 kB/s | 4.2 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs) 5.2 kB/s | 4.1 kB 00:00 Dependencies resolved. Nothing to do. Complete! 5. forcing gnome-software to reload repos and running the instance $ pkill gnome-software $ gnome-software --verbose Stderr: 11:42:00:0380 Gs hiding category games featured applications: found only 0 to show, need at least 9 11:42:04:0110 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:07:0985 Gs not handling error download-failed for action get-updates: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:11:0842 Gs hiding category productivity featured applications: found only 0 to show, need at least 9 11:42:11:0842 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:15:0787 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:24:0242 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:28:0107 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:32:0000 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml 11:42:36:0233 Gs not handling error download-failed for action refine: failed to resolve package_ids: cannot update repo 'rhel-8-for-x86_64_appstream-beta-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 403 for https://cdn.stage.redhat.com/content/beta/8/$osarch/appstream/os/repodata/repomd.xml Note: my $releasever is interpreted wrong: should be: [root@localhost ~]# cat /etc/dnf/vars/releasever rhel8/8 Well, I think 'releasever' is interpreted wrong for you because it is internal yum/dnf variable. ... baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/os ... And gnome-software handles '$releasever' here without a problem. But then we add new custom variable - '$osarch' in my case: ... #baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/os baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/$osarch/appstream/os ... Gnome-software suddenly stops interpreting it. As you see, the only peace of url changed is the replacement of 'x86_64' to '$osarch'. By the way, your inability to reproduce may be because gnome-software also has a cache. I got rid of it by wiping `/var/cache/PackageKit/8.0/`, though I guess there should be better ways to do it (In reply to Denis Volkov from comment #4) > Well, I think 'releasever' is interpreted wrong for you because it is > internal yum/dnf variable. > I didn't know that, thanks. > > By the way, your inability to reproduce may be because gnome-software also > has a cache. I got rid of it by wiping `/var/cache/PackageKit/8.0/`, though > I guess there should be better ways to do it Yes, makes sense now. I tried to do automated test case and I noticed the following: 1.install repos with variables 2.run dnf update Result: dnf update the repo by replacing the variables with actual strings in variables for me. and gnome-software works So the bug here is that gnome-software should force the libdnf/dnf to update repo files before reading them ? (In reply to Martin Krajnak from comment #6) > dnf update the repo by replacing the variables with actual strings in This is very strange, dnf renames only repositories added by subscription manager for me. When I use internal repository, gnome-software is interpreting the variable without problems I even added one more custom variable $distro and in runs smoothly even after I wiped the cache. So to update reproducer: 1. Setup subscription 2. Replacing strings generated by subscription manager to use variables: repo: baseurl = https://cdn.stage.redhat.com/content/beta/$releasever/$osarch/appstream/os 3. adding var [root@localhost ~]# echo 'x86_64' > /etc/dnf/vars/osarch 4. remove cache, forcing gnome-software to reload repos and running the instance # rm -rf /var/cache/PackageKit/* $ rm -rf ~/.cache/gnome-software/* $ pkill gnome-software $ gnome-software --verbose Results: variables is not interpreted however: # dnf update dnf replaced variables with actual strings: baseurl = https://cdn.stage.redhat.com/content/beta/rhel8/8/x86_64/appstream/os $ pkill gnome-software $ gnome-software --verbose there are no variables to interpret, so gnome-software works. 2. reproducer: Setting up variables: # echo 'x86_64' > /etc/dnf/vars/osarch # echo 'rhel' > /etc/dnf/vars/distro internal repo url: baseurl = http://download.eng.brq.redhat.com/pub/$distro/nightly/latest-RHEL-8.*/compose/BaseOS/$osarch/os/ # rm -rf /var/cache/PackageKit/* $ rm -rf ~/.cache/gnome-software/* Result: variables are interpreted, metadata are fetched apps are rendered. So this will be some weird stuff around PackageKit/dnf/gnome-software maybe even subscription manager going on. (In reply to Martin Krajnak from comment #7) > (In reply to Martin Krajnak from comment #6) > > > dnf update the repo by replacing the variables with actual strings in > > This is very strange, dnf renames only repositories added by subscription > manager for me. > When I use internal repository, gnome-software is interpreting the variable > without problems > I even added one more custom variable $distro and in runs smoothly even > after I wiped the cache. no, I made a mistake, repo was configured with skip_if_unavailable = 1, so there were no errors shown in stderr and I got fooled by gnome-software showing me only packages that were already installed mistaking them for actual packages in the repo. So it doesn't work, variable interpretation is broken. Same problem happens with pkcon: # pkcon -c 1 get-updates Getting updates [=========================] Starting [=========================] Loading cache [=========================] Downloading repository information[=========================] Finished [=========================] Loading cache [=========================] Fatal error: cannot update repo 'BaseOS-nightly': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 404 for http://download.eng.brq.redhat.com/pub/rhel/nightly/latest-RHEL-8.*/compose/BaseOS/$osarch/os/repodata/repomd.xml So it looks to me like the problem is in PackageKit. So this seems like not a gnome-software specific issue, moving to dnf. The bug is duplicate of another one (bug 1756382). I solved it few days ago. *** This bug has been marked as a duplicate of bug 1756382 *** |