Bug 1598336

Summary: dnf no longer understands its repository configuration
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: dnfAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 29CC: cyigitsahin, dmach, gmarr, jrohel, mattias.ellert, mblaha, packaging-team-maint, prd-fedora, robatino, rpm-software-management, tom.mannerhagen, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedBlocker
Fixed In Version: dnf-3.6.1-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-07 20:59:14 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:
Bug Depends On:    
Bug Blocks: 1517013    
Attachments:
Description Flags
Backtrace
none
Terminal content when using EN UI-language,
none
Terminal content when using SV UI-language, none

Description Mattias Ellert 2018-07-05 07:19:53 UTC
Description of problem:

With this version of dnf --

# rpm -q dnf
dnf-3.0.1-1.fc29.noarch

-- updates are not possible. Dnf can not parse the configuration files in /etc/yum.conf.d any more.

# dnf update
Förrådet EGI-trustanchors har ingen spegel eller bas-url satt.
Förrådet rawhide har ingen spegel eller bas-url satt.
Förrådet rawhide-debuginfo har ingen spegel eller bas-url satt.
Förrådet rawhide-source har ingen spegel eller bas-url satt.
Fel: Det finns inga aktiva förråd.

It says "no mirror or base-url set". I tried to set LANG to C to get the error message in English for the purpose of this comment, but then dnf suddenly can parse the configuration. However, now it segfaults instead.

# LANG=C.UTF-8 dnf update
Last metadata expiration check: 0:43:42 ago on Wed Jul  4 09:08:21 2018.
Segmenteringsfel (minnesutskrift skapad)

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

dnf-3.0.1-1.fc29.noarc

How reproducible:

Always

Steps to Reproduce:
1. See above

Actual results:

See above

Expected results:

DNF updates packages.

Additional info:

This report was cloned from bug 1596827 comment 2, at the request of Adam Williamson.

Comment 1 Mattias Ellert 2018-07-05 07:33:24 UTC
Created attachment 1456687 [details]
Backtrace

Comment 2 Tom 2018-08-13 13:06:49 UTC
Hi

I see this bug too.
It seems to be language-related because switching language from Swedish to English resolved the problem.

dnf update works fine in englsih environment, but fails in Swedish.

See attached dumps from the respective terminals.

Comment 3 Tom 2018-08-13 13:07:53 UTC
Created attachment 1475577 [details]
Terminal content when using EN UI-language,

Comment 4 Tom 2018-08-13 13:08:29 UTC
Created attachment 1475578 [details]
Terminal content when using SV UI-language,

Comment 5 Jan Kurik 2018-08-14 10:25:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 6 Fedora Blocker Bugs Application 2018-08-20 07:14:41 UTC
Proposed as a Blocker for 29-beta by Fedora user ellert using the blocker tracking app because:

 Impossible to update using dnf.

Comment 7 Geoffrey Marr 2018-08-20 19:56:45 UTC
Discussed during the 2018-08-20 blocker review meeting: [1]

The decision to classify this bug as an "AcceptedBlocker" (Final) was made as it violates the following criteria:

"The installed system must be able appropriately to install, remove, and update software with the default console tool for the relevant software type (e.g. default console package manager)...", affecting Swedish installs (and possibly others) and that using LC_ALL is an acceptable workaround for Beta but not for Final.

[1] https://meetbot.fedoraproject.org/fedora-blocker-review/2018-08-20/f29-blocker-review.2018-08-20-16.00.txt

Comment 8 Daniel Mach 2018-09-17 14:15:05 UTC
Requirement:
dnf install glibc-langpack-sv

Reproducer:
bash -c 'export LANG=sv_SE.UTF-8; dnf clean all; dnf update'

It really complains about missing URL:
msgid "Cannot find a valid baseurl for repo: %s"
msgstr "Kan inte hitta en giltig bas-url för förrådet: %s"

For the record, everything works fine with the Czech locales.

Comment 9 Jaroslav Rohel 2018-09-20 13:13:08 UTC
URL is tested (regular expression) in libdnf.
But there is a change in Evaluation of regular expression since Fedora 28!
(newer gilbc?). How many scripts and programs will be affected?

Explanation of problem:
A range expression '[a-z]' matches character 'w' in LANG=C.
export LANG=C; echo 'w' | grep '[a-z]'

But in LANG=sv_SE.UTF8 it matches only until Fedora 27. Since Fedora 28 (newer glibc?) does not!
export LANG=sv_SE.UTF8; echo 'w' | grep '[a-z]'

Comment 10 Jaroslav Rohel 2018-09-20 13:37:02 UTC
PR: https://github.com/rpm-software-management/libdnf/pull/587

Comment 11 Mattias Ellert 2018-09-20 15:11:59 UTC
(In reply to Jaroslav Rohel from comment #9)
> URL is tested (regular expression) in libdnf.
> But there is a change in Evaluation of regular expression since Fedora 28!
> (newer gilbc?). How many scripts and programs will be affected?
> 
> Explanation of problem:
> A range expression '[a-z]' matches character 'w' in LANG=C.
> export LANG=C; echo 'w' | grep '[a-z]'
> 
> But in LANG=sv_SE.UTF8 it matches only until Fedora 27. Since Fedora 28
> (newer glibc?) does not!
> export LANG=sv_SE.UTF8; echo 'w' | grep '[a-z]'

This is a bit weird.

Until 2006 w was generally considered to be a variant of v in the Swedish alphabet and not a base letter. Since 2006 however, w is considered to be a base letter in the Swedish alphabet. This is because the Swedish Academy's thesaurus published that year listed words beginning with w under a separate heading after words beginning with v, while earlier editions has listed words spelled with v and w interleaved.

So w not matching [a-z] in the Swedish locale would have been correct until 2006 but not now.

Comment 12 Jaroslav Rohel 2018-09-20 16:15:59 UTC
Yes, it is weird. I was suprised when I found this issue.
I fixed the libdnf. And filled bug to glibc.
https://bugzilla.redhat.com/show_bug.cgi?id=1631472

Comment 13 Çağatay Yiğit Şahin 2018-09-30 13:59:23 UTC
I can reproduce the `Cannot find a valid baseurl for repo: updates` error with tr_CY and tr_TR locales but not with sv_SE.UTF-8, sv_SE works correctly.

Comment 14 Çağatay Yiğit Şahin 2018-09-30 14:01:27 UTC
Sorry, forgot to mention DNF version, it is dnf-3.5.1-1.fc29.noarch.

Comment 15 Fedora Update System 2018-10-02 21:18:54 UTC
anaconda-29.24.3-2.fc29 dnf-3.6.1-1.fc29 dnf-plugins-core-3.0.4-1.fc29 dnf-plugins-extras-3.0.2-1.fc29 libdnf-0.20.0-1.fc29 lorax-29.12-3.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-abc8825d92

Comment 16 Fedora Update System 2018-10-02 21:19:11 UTC
anaconda-29.24.3-2.fc29 dnf-3.6.1-1.fc29 dnf-plugins-core-3.0.4-1.fc29 dnf-plugins-extras-3.0.2-1.fc29 libdnf-0.20.0-1.fc29 lorax-29.12-3.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-abc8825d92

Comment 17 Fedora Update System 2018-10-02 23:15:13 UTC
anaconda-29.24.3-2.fc29, dnf-3.6.1-1.fc29, dnf-plugins-core-3.0.4-1.fc29, dnf-plugins-extras-3.0.2-1.fc29, libdnf-0.20.0-1.fc29, lorax-29.12-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-abc8825d92

Comment 18 Jaroslav Rohel 2018-10-04 10:44:06 UTC
(In reply to Çağatay Yiğit Şahin from comment #14)
> Sorry, forgot to mention DNF version, it is dnf-3.5.1-1.fc29.noarch.

I hope it is fixed in libdnf-0.20.0.
Please, try topical DNF with libdnf-0.20.0 (or newer).

Comment 19 Çağatay Yiğit Şahin 2018-10-06 17:36:02 UTC
Thanks! It is fixed.

Comment 20 Fedora Update System 2018-10-07 20:59:14 UTC
anaconda-29.24.3-2.fc29, dnf-3.6.1-1.fc29, dnf-plugins-core-3.0.4-1.fc29, dnf-plugins-extras-3.0.2-1.fc29, libdnf-0.20.0-1.fc29, lorax-29.12-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.