Bug 147124 - yum update dies with TypeErrror
Summary: yum update dies with TypeErrror
Alias: None
Product: Fedora
Classification: Fedora
Component: yum   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
: 147608 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-02-04 15:02 UTC by Steve Grubb
Modified: 2014-01-21 22:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-03 18:54:57 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Steve Grubb 2005-02-04 15:02:06 UTC
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 15:06:22 UTC
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 15:15:55 UTC
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 15:19:59 UTC
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 15:24:24 UTC
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 15:34:04 UTC
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 15:35:36 UTC
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 15:53:22 UTC
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 16:29:52 UTC
This has been fixed in the urlgrabber repository. Thanks for the report.

Comment 9 Seth Vidal 2005-02-09 21:10:01 UTC
*** Bug 147608 has been marked as a duplicate of this bug. ***

Comment 10 Steve Grubb 2005-03-03 18:54:57 UTC
Current version in rawhide solves the problem.

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