Bug 147124 - yum update dies with TypeErrror
yum update dies with TypeErrror
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: 147608 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-02-04 10:02 EST by Steve Grubb
Modified: 2014-01-21 17:51 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-03 13:54:57 EST
Type: ---
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 Steve Grubb 2005-02-04 10:02:06 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041216 Firefox/1.0 Fedora/1.0-6

Description of problem:
Yum dies while updating open office:

Is this ok [y/N]: y
Downloading Packages:
Traceback (most recent call last):
  File "/usr/bin/yum", line 7, in ?
  File "/usr/share/yum-cli/yummain.py", line 146, in main
  File "/usr/share/yum-cli/cli.py", line 630, in doTransaction
    problems = self.downloadPkgs(downloadpkgs)
  File "__init__.py", line 442, in downloadPkgs
  File "repos.py", line 521, in get
  File "mirror.py", line 414, in urlgrab
  File "mirror.py", line 400, in _mirror_try
  File "grabber.py", line 601, in urlgrab
  File "grabber.py", line 533, in _retry
  File "grabber.py", line 587, in retryfunc
  File "grabber.py", line 709, in __init__
  File "grabber.py", line 752, in _do_open
  File "grabber.py", line 817, in _build_range
  File "byterange.py", line 422, in range_tuple_to_header
TypeError: not enough arguments for format string

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.yum update openoffice.org-libs openoffice.org-i18n openoffice.org

Actual Results:  See above

Expected Results:  Complete!

Additional info:

Some updates work. It must be trying to print a special message for
something related to openoffice that it normally doesn't print.
Comment 1 Seth Vidal 2005-02-04 10:06:22 EST
Well that traceback is from inside the downloader module. Can you
download ANY package?

Try to install something new and we'll see what we can come up with.

moreover it's the byte-range downloader which makes me wonder - did
you abort and earlier download of openoffice and maybe it's coming
from the reget handler?
Comment 2 Steve Grubb 2005-02-04 10:15:55 EST
Now that you mention it, I did abort a download of open office. It
hung and I needed to restart it. This seems to be a common problem
across all networking applications on my machines.

But getting back to yum, i just ran this:

Dependencies Resolved
Transaction Listing:
  Update: wget.i386 0:1.9.1-21 - development
Total download size: 408 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): wget-1.9.1-21.i386 100% |=========================| 408 kB    00:02
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating: wget 100 % done 1/2
Completing update for wget  - 2/2

Updated: wget.i386 0:1.9.1-21

I think there is an error message that its trying to output that needs
more parameters or the format string modified.
Comment 3 Seth Vidal 2005-02-04 10:19:59 EST
I'd agree. If you could, try ctrl-c'ing a download in the middle of it
and then restarting it

I'll see if I can replicate this tonight.
Comment 4 Seth Vidal 2005-02-04 10:24:24 EST
yah it looks like it is from here:
def range_tuple_to_header(range_tup):
    """Convert a range tuple to a Range header value.
    Return a string of the form "bytes=<firstbyte>-<lastbyte>".
    if range_tup is None: return None
    range_tup = range_tuple_normalize(range_tup)
    if range_tup:
        if range_tup[1]: 
            range_tup = (range_tup[0],range_tup[1] - 1)
    return 'bytes=%s-%s' % range_tup

the last line, range_tup, which should be a tuple, apparently is not.
Comment 5 Steve Grubb 2005-02-04 10:34:04 EST
Not sure if this is the correct fix, but if I change the function
listed above to this:

    if range_tup is None: return None
    range_tup = range_tuple_normalize(range_tup)
    if range_tup is None: return None
    if range_tup:
        if range_tup[1]:
            range_tup = (range_tup[0],range_tup[1] - 1)
    return 'bytes=%s-%s' % range_tup

it works. I think range_tuple_normalize can return "None" and if
that's handled, it proceeds to download from scratch and everything
seems to be OK. Please double check the above since I don't really
program in Python or there may be other handling that needs to occur.
Comment 6 Seth Vidal 2005-02-04 10:35:36 EST
I think you're exactly right.

I bounced the info to the folks who maintain urlgrabber (the
downloader component used in yum) on yum-devel list.

Comment 7 Steve Grubb 2005-02-04 10:53:22 EST
There's a couple more places in
/usr/lib/python2.4/site-packages/urlgrabber/byterange.py that use
range_tuple_normalize. They should probably be updated similarly just
for completeness. Thanks for looking at this.
Comment 8 Ryan Tomayko 2005-02-04 11:29:52 EST
This has been fixed in the urlgrabber repository. Thanks for the report.
Comment 9 Seth Vidal 2005-02-09 16:10:01 EST
*** Bug 147608 has been marked as a duplicate of this bug. ***
Comment 10 Steve Grubb 2005-03-03 13:54:57 EST
Current version in rawhide solves the problem.

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