Bug 2172868

Summary: [dnf5] dnf5 repoquery mixes up stdout and stderr
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: dnf5Assignee: Evan Goode <egoode>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 41CC: fzatlouk, jkolarik, mhroncok, nsella, pkratoch, ppisar, robatino, rpm-software-management
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---Flags: mhroncok: fedora_prioritized_bug?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: RejectedBlocker
Fixed In Version: dnf5-5.2.6.2-1.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-18 10:56:15 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 Zbigniew Jędrzejewski-Szmek 2023-02-23 11:13:10 UTC
Description of problem:
Program logs and error messages must be written to fd 2 (i.e. stderr), and the actual output to fd 1 (i.e. stdout). Doing anything else makes it very hard to use the program in a pipeline. dnf5 repoquery writes log messages to stdout.

$ dnf5 repoquery 2>/dev/null | grep Repositories
Repositories loaded.

"Repositories loaded." is obviously not a package name.

Version-Release number of selected component (if applicable):
dnf5-5.0.6-1.fc39.x86_64

Comment 1 Fedora Release Engineering 2023-08-16 07:10:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 2 Petr Pisar 2024-04-04 07:27:13 UTC
*** Bug 2223347 has been marked as a duplicate of this bug. ***

Comment 3 František Zatloukal 2024-08-19 18:47:03 UTC
Discussed during the 2024-08-19 blocker review meeting: [1]

The decision to classify this bug as a RejectedBlocker (Final) was made:

"This is annoying, but we don't see anywhere it violates the release criteria. Please re-propose it with more details if there is a criteria violation we're missing."

[1] https://meetbot.fedoraproject.org/blocker-review_matrix_fedoraproject-org/2024-08-19/f41-blocker-review.2024-08-19-15.59.log.html

Comment 4 Miro Hrončok 2024-08-19 20:33:42 UTC
This has been reported a long time ago, please repsond.

Comment 5 Jan Kolarik 2024-08-20 06:20:43 UTC
Sorry, somehow it got out of our sight. I agree this is important to resolve, though it's not a release blocker. We'll try to address it before the release.

Comment 6 Jan Kolarik 2024-08-20 07:53:28 UTC
We've discussed this within the team and decided to close the ticket, leaving the current behavior unchanged. For more details, please refer to the explanation in the upstream ticket: https://github.com/rpm-software-management/dnf5/issues/1361.

Comment 7 Miro Hrončok 2024-08-20 09:37:32 UTC
You just said this is important to resolve.

Comment 8 Jan Kolarik 2024-08-20 10:00:45 UTC
(In reply to Miro Hrončok from comment #7)
> You just said this is important to resolve.

Yes and I believe closing the ticket with an explanation is a valid resolution, right? :) Anyway, thanks for the feedback upstream. I had a slightly different perspective on the distinction between stdout and stderr in this case. We'll look into this, but ensuring consistent behavior across all dnf commands might require a significant amount of work.