Bug 4296 - Package installer goes beyond 100%
Summary: Package installer goes beyond 100%
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: 3.2.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: William Sjöblom
Keywords: prosaic
: 7652 (view as bug list)
Depends on:
Reported: 2012-05-16 09:30 CEST by Peter Åstrand
Modified: 2023-09-21 12:38 CEST (History)
3 users (show)

See Also:
Acceptance Criteria:


Description Peter Åstrand cendio 2012-05-16 09:30:50 CEST
localhost:~/server-bundle # ./install-server 
/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py:248: GtkWarning: gtk_progress_set_percentage: assertion `percentage >= 0 && percentage <= 1.0' failed
  self . __progressbar . set_fraction ( float ( current_step ) / total_steps )
Comment 1 Samuel Mannehed cendio 2014-03-03 16:25:07 CET
Getting this in Fedora 18 as well.
Comment 2 Samuel Mannehed cendio 2021-02-23 16:21:21 CET
*** Bug 7652 has been marked as a duplicate of this bug. ***
Comment 3 Samuel Mannehed cendio 2021-02-23 16:22:29 CET
From bug 7652:

When installing the ThinLinc packages, the progress percentage goes above 100%. I have seen 130% followed by 200% at the end of the package installs on a RHEL8 system.

The relevant algorithm in installer/modules/thinlinc/rpm.py is:

> progress_cb(100*stage/stages + 100*hashes/50/stages)

Where 'stages' are number of packages and 'hashes' are the number of '#' characters per line in the output from rpm.

This means that when installing the last package the percentage will always exceed 100 when rpm output contains '#'.
Comment 4 Samuel Mannehed cendio 2021-02-24 13:21:32 CET
In detail, the "stages" are the number of packages plus 2 (this is explained with that we have a prepare stage and a remove stage).

It seems the 'stage' starts at 0 which means the logic is somewhat correct.

However, that number is incremented for each newline found in the output from "rpm --quiet --hash --upgrade <PACKAGES>", and it seems we get more newlines than the code accounts for. In our example we got 8 packages and 11 newlines.

Perhaps the output has gotten more verbose over the years. It's probably more robust to filter the lines and only look at the relevant output.
Comment 7 William Sjöblom cendio 2021-06-14 12:47:23 CEST
There are apparently more issues related to this bug than just exceeding 100%:

 - We expect 50 hashes per fully completed line when rpm (version only
   gives us 33.
 - For each upgraded package we get an additional hashmark progress bar that is 
   not present for packages that are installed for the first time. This results
   in a percentage being reported that is too low.

Even though the above patch solves the problems described in this bug, we put it 
on hold since it does not correctly handle the above two scenarios.
Comment 8 Pierre Ossman cendio 2022-03-02 17:24:42 CET
I was able to get 500% when upgrading ThinLinc 4.6.0 to ThinLinc 4.14.0post on a RHEL 7 system. :)
Comment 9 Torkil Svensgaard 2023-09-21 12:38:12 CEST
I think we hit 600% when upgrading to 4.15.0. Top that!

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