Bug 1256531 - dnf install crashes if terminal window is too small
dnf install crashes if terminal window is too small
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
AcceptedBlocker https://fedoraproject...
: CommonBugs
: 1258108 (view as bug list)
Depends On:
Blocks: F23FinalBlocker
  Show dependency treegraph
 
Reported: 2015-08-24 16:24 EDT by Dusty Mabe
Modified: 2015-10-05 17:53 EDT (History)
12 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:13:50 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)
Output From DNF Crash (32.74 KB, text/plain)
2015-08-24 16:24 EDT, Dusty Mabe
no flags Details
ABRT Dump from DNF Crash (2.47 KB, application/x-gzip)
2015-08-24 16:25 EDT, Dusty Mabe
no flags Details

  None (edit)
Description Dusty Mabe 2015-08-24 16:24:25 EDT
Created attachment 1066623 [details]
Output From DNF Crash

Description of problem:

If the terminal window is too small DNF can crash. I had kicked off an install and then resized the terminal to be really small while I worked on something else. This resulted in half of the rpms getting installed and half of them not (see full attachment).

The output from the traceback is:
  Installing  : minizip-1.2.8-7.fc22.x86_64                                     12/58
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dnf/yum/rpmtrans.py", line 415, in callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.7/site-packages/dnf/yum/rpmtrans.py", line 493, in _instProgress
    self.total_actions)
  File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 2156, in progress
    percent, process, pkgname, wid1)
  File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 2174, in _out_progress
    pkgname=pkgname, wid1=wid1)
  File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 2230, in _makefmt
    bar = fmt_bar % (self.mark * int(marks * (percent / 100.0)), )
ValueError: unsupported format character '-' (0x2d) at index 6
FATAL ERROR: python callback <bound method RPMTransaction.callback of <dnf.yum.rpmtrans.RPMTransaction object at 0x7f2e33297990>> failed, aborting!

The abrt dump (full dump in attachment) shows:
Local variables in innermost frame:
ts_total: 58L
wid1: 12
pkgname: u'libtiger-0.3.4-9.fc22.x86_64'
full_pnl: -5
percent: 0L
self: <dnf.cli.output.CliTransactionDisplay object at 0x7f2e3966c4d0>
fmt_done: u'%2.2s/%2.2s'
l: 2
ts_done: 13
width: u'-6.-6'
overhead: 26
pnl: 0
done: u'13/58'
marks: -6
fmt_bar: u'[%--6.-6s]'
progress: True
size: u'2.2'


It seems to me like 'mark' getting a negative value is causing this problem:
$ python
Python 2.7.10 (default, Jul  5 2015, 14:15:43) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> marks = -6
>>> width = "%s.%s" % (marks, marks)
>>> fmt_bar = "[%-" + width + "s]"
>>> mark = '#'
>>> percent = 0L
>>> bar = fmt_bar % (mark * int(marks * (percent / 100.0)), )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: unsupported format character '-' (0x2d) at index 6


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

How reproducible:
Always


Steps to Reproduce:
1. Start install
2. Minimize terminal window to be really small
3. Observe failure
Comment 1 Dusty Mabe 2015-08-24 16:25:46 EDT
Created attachment 1066626 [details]
ABRT Dump from DNF Crash
Comment 2 Dusty Mabe 2015-08-25 16:37:26 EDT
Confirmed that this also happens for F23 alpha. Tested against https://download.fedoraproject.org/pub/fedora/linux/releases/test/23_Alpha/Cloud/x86_64/Images/Fedora-Cloud-Base-23_Alpha-20150806.2.x86_64.raw.xz 

[root@localhost ~]# rpm -q dnf
dnf-1.0.2-2.fc23.1.noarch
Comment 3 Fedora Blocker Bugs Application 2015-08-25 16:39:32 EDT
Proposed as a Blocker for 23-alpha by Fedora user dustymabe using the blocker tracking app because:

 It is a bit of a stretch but if someone minimized the terminal window and had the installation crash on them then it may be a violation of:

"The installed system must be able to download and install updates with the default console package manager."

Either way I'd like to see this get fixed.
Comment 4 Adam Williamson 2015-08-31 20:26:37 EDT
There is no point proposing bugs as Alpha blockers, as Alpha has been released. It achieves nothing (no process will pick them up). Moving to Final, you can move to Beta if you like but it feels Final-ish to me.
Comment 5 Dusty Mabe 2015-08-31 22:10:41 EDT
Hey Adam. Sorry about that. I chose alpha because that was the release criteria I was referencing (see [1]). I knew alpha was out. Next time I'll just propose it for whatever the "next" milestone is.

Thanks!

[1] - http://fedoraproject.org/wiki/Fedora_23_Alpha_Release_Criteria#Installer_must_run
Comment 6 Adam Williamson 2015-08-31 22:20:06 EDT
Yep - all Alpha criteria apply to Beta, and all Alpha and Beta criteria apply to Final. So if you find a violation of an 'older' criterion just go ahead and nominate against the next milestone.
Comment 7 Honza Silhan 2015-09-01 08:27:01 EDT
*** Bug 1258108 has been marked as a duplicate of this bug. ***
Comment 8 Adam Williamson 2015-09-10 15:26:46 EDT
Discussed at 2015-09-10 blocker review meeting: https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2015-09-10/f23-blocker-review.2015-09-10-16.00.log.txt . Accepted as a Final blocker. We acknowledge that not many users are likely to hit this - making the terminal smaller while a transaction is in progress seems like a fairly unusual thing to do - but we considered that the impact of this bug is so severe (crashing during a package transaction leaves the entire system in an inconsistent and potentially broken state) that even one person hitting it would be too many. Basically we reckon any known bug that can cause the package manager to crash in the middle of a transaction is almost certainly a release blocker.

Criterion is "The installed system must be able to download and install updates with the default console package manager.", with the note that it's a conditional violation but the *consequences* are so severe it constitutes a blocker.

We will also document this for Beta.
Comment 9 Adam Williamson 2015-09-22 02:20:35 EDT
Can we please get a fix for this ASAP? A crasher bug during package install in a stable release (this affects both 22 and 23) is not a good thing...thanks!
Comment 10 Fedora Update System 2015-09-22 11:00:41 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 11 Fedora Update System 2015-09-22 11:02:52 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 12 Fedora Update System 2015-09-22 23:54:30 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 13 Fedora Update System 2015-09-23 17:22:22 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 14 Adam Williamson 2015-09-30 18:32:15 EDT
So the update to fix this was the one that busted dnf entirely; both F22 and F23 updates have been negative karma'ed to oblivion.

I see newer builds for both 22 and 23 in Koji:

http://koji.fedoraproject.org/koji/buildinfo?buildID=688785
http://koji.fedoraproject.org/koji/buildinfo?buildID=688786

but no update for either in Bodhi. If these are ready to go could you please submit updates? Thanks!
Comment 15 Fedora Update System 2015-10-02 11:20:39 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 16 Fedora Update System 2015-10-02 11:24:39 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 17 Fedora Update System 2015-10-03 21:36:12 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 18 Fedora Update System 2015-10-03 21:52:06 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 19 Fedora Update System 2015-10-04 15:12:56 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 20 Fedora Update System 2015-10-05 17:52:26 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.