Bug 1258364 - Some important dnf output goes to STDERR and not to STDOUT
Summary: Some important dnf output goes to STDERR and not to STDOUT
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-31 08:03 UTC by Joachim Backes
Modified: 2015-10-05 21:53 UTC (History)
10 users (show)

Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-04 19:14:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Joachim Backes 2015-08-31 08:03:55 UTC
Description of problem:
Some dnf messages are not relevant to me, so I redirect STDERR to 
/dev/null if using dnf. But this has the disadvantage the the prompt 
"Is this ok [y/N]:" gets lost too. Obviously it is written to STDERR.

Version-Release number of selected component (if applicable):
dnf-1.1.0-2.fc23.noarch

How reproducible:
always

Steps to Reproduce:
1.start dnf by "sudo 2>/dev/null dnf install <some not installed package>
2.
3.

Actual results:
Lost prompt "Is this ok [y/N]:"

Expected results:
Seeing this prompt for answering it

Additional info:

Comment 1 Erich Cordoba 2015-09-01 04:10:54 UTC
dnf uses raw_input() and input() functions. The behavior described seems to be related to this known bug in python (reported 5 years ago). 

http://bugs.python.org/issue1927

And also: 

http://bugs.python.org/issue24402

Comment 2 Honza Silhan 2015-09-01 12:45:52 UTC
it should be fixed in python. We can import readline but this is an ugly hack.

Comment 3 Fedora Update System 2015-09-22 15:00:27 UTC
hawkey-0.6.1-1.fc23 dnf-plugins-core-0.1.12-2.fc23 dnf-1.1.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 4 Fedora Update System 2015-09-22 15:02:41 UTC
dnf-plugins-core-0.1.12-2.fc22 hawkey-0.6.1-1.fc22 dnf-1.1.2-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 5 Fedora Update System 2015-09-23 03:54:21 UTC
dnf-1.1.2-2.fc23, dnf-plugins-core-0.1.12-2.fc23, hawkey-0.6.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 6 Fedora Update System 2015-09-23 21:22:12 UTC
dnf-1.1.2-2.fc22, dnf-plugins-core-0.1.12-2.fc22, hawkey-0.6.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 7 David Shea 2015-09-24 15:38:11 UTC
The readline import is breaking anaconda. Please don't.

Comment 8 Honza Silhan 2015-09-24 17:48:41 UTC
David, can you elaborate how does "readline import" break Anaconda, please?

Comment 9 David Shea 2015-09-24 17:55:55 UTC
Core file from rawhide: https://dshea.fedorapeople.org/core.dnf-readline.xz

The 'import readline' line is crashing in rl_initialize. We've seen this behavior before caused by the import calling functions in libedit instead of libreadline.

Comment 10 Adam Williamson 2015-09-25 15:12:50 UTC
basically it seems there are symbol collisions between libedit and libreadline, and any Python code that's linked against libedit but calls rl_initialize will have issues.

The case I recall having before was slightly different: https://bugzilla.redhat.com/show_bug.cgi?id=1201897

in that case it was actually hawkey which had a collision with libedit, and it was ultimately resolved by having libedit mark the offending symbols in that case as hidden. Would we be able to do the same here, or are the symbols that collide between libedit and readline actually meant to be public?

Comment 11 Honza Silhan 2015-09-30 13:36:45 UTC
I also believe this should be fixed in libedit/libreadline libraries. In the meantime I merged the patch for DNF that doesn't import readline: https://github.com/rpm-software-management/dnf/commit/32ce3af9f511e894a98703dd8e97cfae26eb47d3

The build dnf-1.1.2 for F22 and F23 will be made today.

Comment 12 Adam Williamson 2015-09-30 15:26:27 UTC
"I also believe this should be fixed in libedit/libreadline libraries."

Actually I was probably wrong there, the thing is libedit and libreadline are basically alternative implementations of the same thing, so it doesn't really ever make sense to wind up with both linked in the same binary and I doubt we'd get much joy out of asking them to rename symbols so they don't collide.

So yeah, it seems a good idea to avoid the readline import in general. FWIW this would also affect anything else that wanted to import dnf but somehow happened to be linking against libedit. Thanks for the fix.

Looking at the linked bug reports, seems like the 'right' fix would be in upstream Python but it isn't going to arrive any day soon :/

Comment 13 Fedora Update System 2015-10-02 15:20:55 UTC
dnf-plugins-core-0.1.12-3.fc23 hawkey-0.6.1-2.fc23 dnf-1.1.2-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 14 Fedora Update System 2015-10-02 15:24:50 UTC
dnf-plugins-core-0.1.12-3.fc22 hawkey-0.6.1-2.fc22 dnf-1.1.2-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 15 Fedora Update System 2015-10-04 01:36:22 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 16 Fedora Update System 2015-10-04 01:52:14 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 17 Fedora Update System 2015-10-04 19:13:04 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2015-10-05 21:52:34 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, 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.