Bug 10436 - gurpmi: progress bar miscalculation if download of some packages fail
Summary: gurpmi: progress bar miscalculation if download of some packages fail
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal minor
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 10:21 CEST by Pablo Saratxaga
Modified: 2017-12-02 12:26 CET (History)
3 users (show)

See Also:
Source RPM: gurpmi-7.27.3-2.mga3
CVE:
Status comment:


Attachments

Description Pablo Saratxaga 2013-06-05 10:21:55 CEST
The global progress bar is calculated at line 192 of /usr/lib/perl5/vendor_perl/5.16.3/gurpm/RPMProgressDialog.pm 

In some cases (I always launch tools from terminal to see messages) a lot of error messages are displayed, telling the percent value is out of bond (it must be betwenn 0.00 and 1.00).

After doing some tests, it appears the problem is triggered when downloading of some packages fail; if a lot of them fail (for example, due to a network problem :) ), and you click on "continue anyway"; then the calculated number of packages can become negative; and as a result the calculated fraction becomes negative, that is, inferior to 0.00, which isn't allowed.

The number of packages to install should obiously never be negative, so there is a bug in the logic calculating that value somewhere.


PS: a maybe related bug (maybe fixed?) : bug #778


Reproducible: 

Steps to Reproduce:
Pablo Saratxaga 2013-06-05 10:22:15 CEST

CC: (none) => pablo

Comment 1 Pablo Saratxaga 2013-06-05 10:26:38 CEST
it is $urpm->{nb_install} that sometimes get negative (value: -35)
it can be seen also in the text info: "installing foo.rpm (112/-35)"
Manuel Hiebel 2013-06-08 16:47:35 CEST

Keywords: (none) => Triaged
Assignee: bugsquad => thierry.vignaud

Comment 2 Thierry Vignaud 2013-06-08 18:20:46 CEST
We decrement the number of total packages when some packages are missing:

 $urpm->{nb_install} -= scalar @missing;

in /usr/lib/perl5/vendor_perl/5.18.0/urpm/main_loop.pm

Else we see urpmi ending with eg:

"(...)
 14/20: foo
 15/20: bar
While some packages may have been installed, there were failures."


Obviously something went wrong here.
Do you have the log of such a failure?
Comment 3 Pablo Saratxaga 2013-06-11 10:03:07 CEST
I don't have the log anymore; but it can be easily reproduced (or something similar) by shutting down network (eg: unplug cable, or do ifdown eth0) when downloading rpm packages.
it then complains about "something went wrong" and ask if I want to install anyway.

It seems the missed packages are removed twice (or maybe even more?) from nb_install.

BTW, it would be a nice improvement to have a "try downloading missing packages again?" option for such cases, instead of just dropping the whole transaction, or going ahead with missing packages.
Comment 4 Marja Van Waes 2016-06-24 21:21:58 CEST
This bug report saw no action since over 3 years ago.

Is it still valid?

Keywords: Triaged => NEEDINFO
CC: (none) => marja11

Comment 5 Thierry Vignaud 2016-06-24 21:27:34 CEST
It surely is
Marja Van Waes 2016-06-24 21:39:22 CEST

Keywords: NEEDINFO => (none)

Marja Van Waes 2017-12-02 12:26:49 CET

CC: (none) => mageiatools


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