Bug 2245773 - dnf 4.18 broke fedora-update-feedback
Summary: dnf 4.18 broke fedora-update-feedback
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Blaha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-24 03:22 UTC by Geraldo Simião
Modified: 2023-11-10 01:47 UTC (History)
9 users (show)

Fixed In Version: dnf-4.18.1-1.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-10 01:47:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dnf 4.18 and 4.17 output diff (309.22 KB, image/jpeg)
2023-10-26 03:44 UTC, Geraldo Simião
no flags Details
dnf 4.18 output on a fresh installed F39 KDE (78.39 KB, image/jpeg)
2023-10-26 04:12 UTC, Geraldo Simião
no flags Details

Description Geraldo Simião 2023-10-24 03:22:57 UTC
Description of problem:
When trying to start fedora-update-feedback-2.1.2-3.fc39.x86_64, it asks for FAS password, after typing the correct password it start querying the repositories and returns: 
Error: "Failed to parse dnf output: input contains invalid characters"

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

fedora-update-feedback-2.1.2-3.fc39.x86_64
dnf 4.18.0-2.fc39

How reproducible:
allways

Steps to Reproduce:
1.start fedora-update-feedback
2.type FAS password and wait
3.get ERROR

Actual results:
Error message

Expected results:
Query repos and start feedback session

Aditional info:
After downgrade back to dnf-4.17.0-6.fc39 fedora-update-feedback worked again

Comment 1 Marek Blaha 2023-10-24 06:46:07 UTC
From fedora-update-feedback sources it looks like the error is raised here: https://github.com/ironthree/fedora-update-feedback/blob/66b163c113cef52ff151f354d44e5e990bcbc5f4/src/sysinfo.rs#L203

This line parses install time from output of the `dnf --quiet repoquery --cacheonly --installed --qf "%{name}-%{version}-%{release}.%{arch}\t%{installtime}"` command. Unfortunately the error message does not contain the incorrect input line. Maybe running this command with dnf-4.17 and dnf-4.18 and comparing the outputs might help? Unfortunately I cannot reproduce the issue on my system.

I also checked the changes in dnf between 4.17 and 4.18 and did not noticed any change related to repoquery.

Comment 2 Fabio Valentini 2023-10-24 10:43:02 UTC
I also cannot reproduce this issue with dnf 4.18.0-2.fc39 and fedora-update-feedback-2.1.2-3.fc39.x86_64.

The error you see comes from `Utc.datetime_from_str(installtime, "%Y-%m-%d %H:%M")`, so it looks like on your system, some packages don't have valid installtime timestamps in the dnf database ... have you used dnf5 to install / upgrade some packages on this system?

Comment 3 Geraldo Simião 2023-10-25 11:05:59 UTC
Yes, I have tested some install and remove packages using dnf5. But that was some weeks ago, before dnf was upgraded, and fedora-update-feedback was working fine (and still working after I downgraded dnf)
I'll try test this on a VM to see if I can reproduce it there.

Comment 4 Geraldo Simião 2023-10-25 17:50:43 UTC
(In reply to Fabio Valentini from comment #2)
> I also cannot reproduce this issue with dnf 4.18.0-2.fc39 and
> fedora-update-feedback-2.1.2-3.fc39.x86_64.
> 
> The error you see comes from `Utc.datetime_from_str(installtime, "%Y-%m-%d
> %H:%M")`, so it looks like on your system, some packages don't have valid
> installtime timestamps in the dnf database ... have you used dnf5 to install
> / upgrade some packages on this system?

Fabio, how can I certify that this is happening on my install? I already did a sudo rpm -v --rebuilddb and the problems persists.

Comment 5 Fabio Valentini 2023-10-25 17:57:55 UTC
You can try running:

$ dnf --quiet repoquery --cacheonly --installed --qf "%{name}-%{version}-%{release}.%{arch}\t%{installtime}"

The second column (after the TAB character) should contain valid timestamps for all installed packages, but on your system, it appears that this is not the case with dnf 4.18.

Comment 6 Marek Blaha 2023-10-25 18:54:57 UTC
@geraldo.simiao.kutz Please, run

$ dnf --quiet repoquery --cacheonly --installed --qf "%{name}-%{version}-%{release}.%{arch}\t%{installtime}"

command with both dnf 4.18 and dnf 4.17 and post here the diff of results. It should help identify installed packages with strange installtime  causing fedora-update-feedback to fail.

Comment 7 Geraldo Simião 2023-10-26 03:44:58 UTC
Created attachment 1995507 [details]
dnf 4.18 and 4.17 output diff

Yeah, the problem is really this: at dnf 4.18 here the output is DDMMYYYY and with dnf 4.17 is YYYYMMDD
Ex:
dnf 4.18 => Box2D-2.4.1-11.fc39.x86_64	21-09-2023 01:54
dnf 4.17 => Box2D-2.4.1-11.fc39.x86_64	2023-09-21 01:54

Comment 8 Geraldo Simião 2023-10-26 04:12:51 UTC
Created attachment 1995508 [details]
dnf 4.18 output on a fresh installed F39 KDE

Now I tested the new RC iso from https://dl.fedoraproject.org/pub/alt/stage/39_RC-1.1/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-39-1.1.iso on a VM and it have the same output from my installed F39 baremetal install.
Both are System Locale: LANG=pt_BR.UTF-8

Comment 9 Marek Blaha 2023-10-26 10:03:51 UTC
Thank you, I think I understand it now:

This commit - https://github.com/rpm-software-management/dnf/commit/1daf3467e60bbd54998cab79bcabe4e3a8d4d153, enabled translators to modify formatting strings for their respective languages. Although the commit was merged some time ago, the issue only came to light when translators actually modified the timestamp formatting string for the pt_BR locale. This change occurred during the 4.18 release cycle, as you can see here: https://github.com/rpm-software-management/dnf/blob/6a6b575244b0c5a5713dbd16949f4922e21f1ef6/po/pt_BR.po#L2108-L2116

Comment 10 Fabio Valentini 2023-10-26 10:16:37 UTC
I think it's a bad idea to mark something that's machine-parseable as translatable.
If the date format returned for `%{installtime}` is not stable in `repoquery`, then I cannot rely on it, and would need to drop a feature that was requested by multiple people.

Comment 11 Marek Blaha 2023-10-26 10:32:30 UTC
Right, I'll prepare a patch to revert this change.

Comment 12 Marek Blaha 2023-10-26 11:04:34 UTC
PR https://github.com/rpm-software-management/dnf/pull/2008 reverts repoquery timestamps format translating.

Comment 13 Fabio Valentini 2023-10-26 11:27:09 UTC
Looks great, thank you!

Comment 14 Geraldo Simião 2023-10-27 01:20:07 UTC
I just did a build with this commit on my copr, and test it. It works fine, really fix the bug at my setup.
https://copr.fedorainfracloud.org/coprs/geraldosimiao/testing/package/dnf/

Comment 15 Geraldo Simião 2023-10-27 20:09:41 UTC
so, now its just wait for the PR to be accepted, a new build and then the bodhi update with it, right?

Comment 16 Marek Blaha 2023-10-30 07:09:29 UTC
Yes. The patch has been merged to upstream and will be part of next dnf release for Fedoras.

Comment 17 Marek Blaha 2023-10-30 07:13:05 UTC
Meanwhile you can workaround the issue by setting "C" locale:
$ LANG="C" fedora-update-feedback

Comment 18 Fedora Update System 2023-11-07 09:21:28 UTC
FEDORA-2023-20e641bc5a has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-20e641bc5a

Comment 19 Fedora Update System 2023-11-08 02:57:48 UTC
FEDORA-2023-20e641bc5a has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-20e641bc5a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-20e641bc5a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Geraldo Simião 2023-11-09 11:02:36 UTC
New update fixed confirmed. All is fine again. Thanks.

Comment 21 Fedora Update System 2023-11-10 01:47:31 UTC
FEDORA-2023-20e641bc5a has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.