Bug 963023 - delta RPM's rebuild crash when creating starting the progress bar
delta RPM's rebuild crash when creating starting the progress bar
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On: 963645
  Show dependency treegraph
Reported: 2013-05-14 22:03 EDT by Ian Firns
Modified: 2014-05-13 00:57 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-05-13 00:57:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ian Firns 2013-05-14 22:03:40 EDT
Description of problem:
Building a custom ISO via livecd-creator whereby the downloaded package list contains some delta RPM's the rebuilding process crashes when trying to display the progress.

Version-Release number of selected component (if applicable):
yum 3.4.3-91.fc19

How reproducible:
Fairly easily provided an update incorporated delta rpms.

Actual results:
Traceback (most recent call last):
  File "/bin/livecd-creator", line 237, in <module>
  File "/bin/livecd-creator", line 218, in main
  File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 655, in install
  File "/usr/lib/python2.7/site-packages/imgcreate/yuminst.py", line 212, in runInstall
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 2378, in downloadPkgs
  File "/usr/lib/python2.7/site-packages/yum/drpm.py", line 278, in dequeue_all
    self.progress.start(text='<locally rebuilding deltarpms>', size=total)

Expected results:
Progress bar to show and delta RPM's to be rebuilt

Additional info:
Issue arises from zpavals's commit 89f8953f. A simple one to fix, but I haven't delved too much into yum's internals to provide a suitable patch.

Comment 1 Zdeněk Pavlas 2013-05-15 03:05:10 EDT
Thanks, thought I've already fixed this in commit fa2f72499... It's clear that here self.progress evaluates to True.  My reproducer for BZ 952357 does not trigger this.  What's the exception that is being raised, anyway?  (you posted just the stack trace)
Comment 2 Ian Firns 2013-05-15 04:10:25 EDT
Oops, copy and pasting is clearly new to me. The exception is:

TypeError: start() takes at least 3 arguments (1 given)

I would have thought you supplying at least 2 arguments there, but clearly it's a python'ism that eludes me.
Comment 3 Zdeněk Pavlas 2013-05-15 04:43:29 EDT
Ah, thanks.  Seems that livecd-creator uses it's own progress callback, with an incompatible signature than our BaseMeter.

class BaseMeter:
    def start(self, filename=None, url=None, basename=None,
              size=None, now=None, text=None):

I guess they've dropped the default values for filename and url, so they are positional arguments now.  That's a bug, but working it around in Yum is simple.  Please, as it's nontrivial to reproduce, could you verify that the following helps?

commit 85132da3060913378235c6ba8597aa4865d97885
Author: Zdenek Pavlas <zpavlas@redhat.com>
Date:   Wed May 15 10:41:08 2013 +0200

    progress.start: supply the default filename & url.  BZ 963023

diff --git a/yum/drpm.py b/yum/drpm.py
index b04779d..a3ddbb1 100644
--- a/yum/drpm.py
+++ b/yum/drpm.py
@@ -275,7 +275,7 @@ class DeltaInfo:
                 if hasattr(progress, 'text_meter_total_size'):
                 self.progress = po.repo.callback
-                self.progress.start(text='<locally rebuilding deltarpms>', size=total)
+                self.progress.start(None, None, text='<locally rebuilding deltarpms>', size=total)
                 self.done = 0
         while self._future_jobs:
Comment 4 Ian Firns 2013-05-16 07:33:27 EDT
I'm not able to hit this at the moment due to know drpm's coming down the pipeline. The patch is in and I'll confirm as soon as possible.
Comment 5 Ian Firns 2013-05-29 20:51:35 EDT
I finally had some drpms come down the line and the above patch works as expected.
Comment 6 Chris Smart 2013-06-11 04:59:24 EDT
I have hit this bug and can also confirm that after applying the change to drpm.py the problem goes away. Thanks.

Comment 7 Ian Firns 2014-05-13 00:57:23 EDT
Above patch works as expected.

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