Bug 1258364 - Some important dnf output goes to STDERR and not to STDOUT
Some important dnf output goes to STDERR and not to STDOUT
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-31 04:03 EDT by Joachim Backes
Modified: 2015-10-05 17:53 EDT (History)
10 users (show)

See Also:
Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-04 15:14:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joachim Backes 2015-08-31 04:03:55 EDT
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 00:10:54 EDT
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 08:45:52 EDT
it should be fixed in python. We can import readline but this is an ugly hack.
Comment 3 Fedora Update System 2015-09-22 11:00:27 EDT
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 11:02:41 EDT
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-22 23:54:21 EDT
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 17:22:12 EDT
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 11:38:11 EDT
The readline import is breaking anaconda. Please don't.
Comment 8 Honza Silhan 2015-09-24 13:48:41 EDT
David, can you elaborate how does "readline import" break Anaconda, please?
Comment 9 David Shea 2015-09-24 13:55:55 EDT
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 11:12:50 EDT
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 09:36:45 EDT
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 11:26:27 EDT
"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 11:20:55 EDT
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 11:24:50 EDT
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-03 21:36:22 EDT
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-03 21:52:14 EDT
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 15:13:04 EDT
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 17:52:34 EDT
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.