Bug 1645413

Summary: mirrorlist parsing is broken
Product: [Fedora] Fedora Reporter: Ralf Corsepius <rc040203>
Component: dnfAssignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 29CC: dmach, mblaha, mhatina, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
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: 2018-11-05 07:53:51 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 Ralf Corsepius 2018-11-02 07:54:15 UTC
Description of problem:

When using a mirrorlist in a /etc/yum.repos.d/*.repo pointing to a mirrorlist-file, variables inside of this mirrorlist-file are not being expanded anymore and cause dnf to fail.

Real world-example:

# cat /etc/yum.repos.d/packman.repo:
[packman]
name=Packman for Fedora $releasever - $basearch
mirrorlist=http://packman.links2linux.de/mirrorlists/fedora
enabled=1
gpgcheck=1
gpgkey= file:///etc/pki/rpm-gpg/packman-ralcor.gpg

# curl http://packman.links2linux.de/mirrorlists/fedora
http://packman.inode.at/fedora/$releasever/$basearch/
http://packman.jacobs-university.de/fedora/$releasever/$basearch/
http://ftp.fau.de/packman/fedora/$releasever/$basearch/
http://ftp.halifax.rwth-aachen.de/packman/fedora/$releasever/$basearch/
http://ftp.gwdg.de/pub/linux/misc/packman/fedora/$releasever/$basearch/
http://ftp.twaren.net/Linux/Packman/fedora/$releasever/$basearch/
http://mirror.karneval.cz/pub/linux/packman/fedora/$releasever/$basearch/
http://mirrors.hust.edu.cn/packman/fedora/$releasever/$basearch/
http://ftp.yzu.edu.tw/Linux/packman/fedora/$releasever/$basearch/


Using this, dnf on f29 fails to download the repo:
# dnf update --refresh --repo=packman
Packman for Fedora 29 - x86_64                     24  B/s | 345  B     00:14    
Failed to synchronize cache for repo 'packman', ignoring this repo.
...

On f28, this setup works:
# dnf update --refresh --repo=packman
Last metadata expiration check: 0:00:00 ago on Fri 02 Nov 2018 08:46:29 AM CET.
...

Version-Release number of selected component (if applicable):
dnf-4.0.4-1.fc29.noarch

How reproducible:
Always.

Steps to Reproduce:
1. install the /etc/yum.repos.d/packman.repo above and run 
"dnf update --refresh --repo=packman"

Actual results:
dnf fails. 

Apparent cause seems to dnf not expanding the variables contained in the remote mirrorlist file:

# dnf update --refresh --repo=packman -d 3
...
DNF version: 4.0.4
cachedir: /var/cache/dnf
repo: downloading from remote: packman
error: Status code: 404 for http://packman.inode.at/fedora/$releasever/$basearch/repodata/repomd.xml (http://packman.inode.at/fedora/$releasever/$basearch/repodata/repomd.xml).
error: Status code: 404 for http://packman.jacobs-university.de/fedora/$releasever/$basearch/repodata/repomd.xml (http://packman.jacobs-university.de/fedora/$releasever/$basearch/repodata/repomd.xml).
...
Cannot download 'http://packman.links2linux.de/mirrorlists/fedora': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
Failed to synchronize cache for repo 'packman', ignoring this repo.
...

Expected results:
Function.

Comment 1 Marek Blaha 2018-11-05 07:53:51 UTC

*** This bug has been marked as a duplicate of bug 1637148 ***