Bug 133051 - Yum dies at "yum update" with "TypeError: iteration over non-sequence"
Summary: Yum dies at "yum update" with "TypeError: iteration over non-sequence"
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC3Blocker
TreeView+ depends on / blocked
 
Reported: 2004-09-21 06:26 UTC by Robert Scheck
Modified: 2014-01-21 22:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-23 17:31:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Robert Scheck 2004-09-21 06:26:50 UTC
Description of problem:
--- snipp ---
[root@devel root]# yum update
Setting up Update Process
Setting up Repo:  base
repomd.xml                100% |=========================|  903 B    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 251 kB    00:00
base      : ################################################## 804/804
Excluding Packages
Excluding Incompatible Archs
Finished
Excluding Packages from Development (i386/base)
Resolving Dependencies
Traceback (most recent call last):
  File "/usr/share/yum-cli/yummain.py", line 139, in ?
    main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 94, in main
    (result, resultmsgs) = base.buildTransaction()
  File "__init__.py", line 131, in buildTransaction
  File "depsolve.py", line 151, in resolveDeps
  File "depsolve.py", line 97, in populateTs
TypeError: iteration over non-sequence
[root@devel root]# 
--- snapp ---

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

How reproducible:
Everytime, see below.

Steps to Reproduce:
1. "yum update"
2. Get the error.
  
Actual results:
Yum isn't working.

Expected results:
Yum should work.

Comment 1 Seth Vidal 2004-09-21 06:30:05 UTC
Yes, this is currently being addressed on the yum-devel mailing list.
We're all having a little trouble figuring out how this could occur
unless the ts is not being created at all, which seems a bit unlikely.



Comment 2 Seth Vidal 2004-09-21 06:32:04 UTC
if you can recreate it  - add:

print dir(self.ts)
as the first line of the populateTs function in
/usr/lib/python-2.3/site-packages/yum/depsolve.py

and send me the output.

thanks


Comment 3 Robert Scheck 2004-09-21 06:59:12 UTC
Okay, here's the new output - with this print:

--- snipp ---
[root@devel root]# yum update 
Setting up Update Process 
Setting up Repo:  base 
repomd.xml                100% |=========================|  903 B    00:00 
Reading repository metadata in from local files 
base      : ################################################## 804/804 
Excluding Packages 
Excluding Incompatible Archs 
Finished 
Excluding Packages from Development (i386/base) 
Resolving Dependencies 
['__doc__', '__getattr__', '__init__', '__module__', '_methods', 'getMethod', 'popVSFlags', 'pushVSFlags', 'returnLeafNodes', 'test', 'ts', 'tsflags'] 
Traceback (most recent call last): 
  File "/usr/share/yum-cli/yummain.py", line 139, in ? 
    main(sys.argv[1:]) 
  File "/usr/share/yum-cli/yummain.py", line 94, in main 
    (result, resultmsgs) = base.buildTransaction() 
  File "__init__.py", line 131, in buildTransaction 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 152, in resolveDeps 
    self.populateTs(test=1) 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 98, in populateTs 
    for te in self.ts: 
TypeError: iteration over non-sequence 
[root@devel root]#
--- snapp ---

Comment 4 Seth Vidal 2004-09-21 07:01:35 UTC
well ain't that just a pain in the arse.

okay.

Thanks


Comment 5 Paul Nasrat 2004-09-21 07:15:24 UTC
Can you modify the print statement to be:

print "self.ts: %s %s self.ts.ts: %s %s" % ( type(self.ts),
dir(self.ts), type(self.ts.ts), dir(self.ts.ts)"

And paste that output here please.

Thanks

Comment 6 Robert Scheck 2004-09-21 07:32:13 UTC
Yes, I did this, here is the result:

--- snipp ---
[root@devel root]# yum update 
Setting up Update Process 
Setting up Repo:  base 
repomd.xml                100% |=========================|  903 B    00:00 
Reading repository metadata in from local files 
base      : ################################################## 804/804 
Excluding Packages 
Excluding Incompatible Archs 
Finished 
Excluding Packages from Development (i386/base)
Resolving Dependencies 
self.ts: <type 'instance'> ['__doc__', '__getattr__', '__init__', 
'__module__', '_methods', 'getMethod', 'popVSFlags', 'pushVSFlags', 
'returnLeafNodes', 'test', 'ts', 'tsflags'] self.ts.ts: <type 
'rpm.ts'> ['Debug', 'IDTXglob', 'IDTXload', 'addErase', 'addInstall', 
'check', 'clean', 'closeDB', 'dbMatch', 'getKeys', 'hdrCheck', 
'hdrFromFdno', 'initDB', 'next', 'openDB', 'order', 
'pgpImportPubkey', 'pgpPrtPkts', 'rebuildDB', 'rollback', 'run', 
'setColor', 'setFlags', 'setProbFilter', 'setVSFlags', 'verifyDB'] 
Traceback (most recent call last): 
  File "/usr/share/yum-cli/yummain.py", line 139, in ? 
    main(sys.argv[1:]) 
  File "/usr/share/yum-cli/yummain.py", line 94, in main 
    (result, resultmsgs) = base.buildTransaction() 
  File "__init__.py", line 131, in buildTransaction 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 152, in resolveDeps 
    self.populateTs(test=1) 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 98, in populateTs 
    for te in self.ts: 
TypeError: iteration over non-sequence 
[root@devel root]# 
--- snapp ---

Prod me, if you need further information and tests.

Comment 7 Paul Nasrat 2004-09-21 12:45:04 UTC
looks like we should be iterating over self.ts.ts or maybe
TransactionWrapper should implement __iter__().

Comment 8 Robert Scheck 2004-09-21 12:52:30 UTC
Here's the result for your suggested change:

--- snipp ---
[root@devel root]# yum update 
Setting up Update Process 
Setting up Repo:  base 
repomd.xml                100% |=========================|  903 B    00:00 
Reading repository metadata in from local files 
base      : ################################################## 804/804 
Excluding Packages 
Excluding Incompatible Archs 
Finished 
Excluding Packages from Development (i386/base)
Resolving Dependencies 
self.ts: <type 'instance'> ['__doc__', '__getattr__', '__init__', 
'__module__', '_methods', 'getMethod', 'popVSFlags', 'pushVSFlags', 
'returnLeafNodes', 'test', 'ts', 'tsflags'] self.ts.ts: <type 
'rpm.ts'> ['Debug', 'IDTXglob', 'IDTXload', 'addErase', 'addInstall', 
'check', 'clean', 'closeDB', 'dbMatch', 'getKeys', 'hdrCheck', 
'hdrFromFdno', 'initDB', 'next', 'openDB', 'order', 
'pgpImportPubkey', 'pgpPrtPkts', 'rebuildDB', 'rollback', 'run', 
'setColor', 'setFlags', 'setProbFilter', 'setVSFlags', 'verifyDB'] 
ncurses-5.4-13.i386.rpm   100% |=========================| 273 kB    00:00 
modutils-2.4.27-2.i386.rp 100% |=========================|  19 kB    00:00 
libxslt-python-1.1.10-1.i 100% |=========================| 5.0 kB    00:00 
libxslt-devel-1.1.10-1.i3 100% |=========================| 7.6 kB    00:00 
procps-3.2.3-3.i386.rpm   100% |=========================|  15 kB    00:00 
Traceback (most recent call last): 
  File "/usr/share/yum-cli/yummain.py", line 139, in ? 
    main(sys.argv[1:]) 
  File "/usr/share/yum-cli/yummain.py", line 94, in main 
    (result, resultmsgs) = base.buildTransaction() 
  File "__init__.py", line 131, in buildTransaction 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 152, in resolveDeps 
    self.populateTs(test=1) 
  File "/usr/lib/python2.3/site-packages/yum/depsolve.py", line 116, in populateTs 
    hdr = po.getHeader() 
  File "packages.py", line 272, in getHeader 
IndexError: list index out of range 
[root@devel root]#
--- snapp ---

Does this help you?

Comment 9 Seth Vidal 2004-09-21 13:23:19 UTC
the wrapper passes any methods it doesn't define on to the self.ts.ts
attribute.

so iterating over self.ts just like self.ts.ts should be quite safe.

I could add __iter__() that handed back self.ts as the iterable object
but it doesn't seem necessary

Comment 10 Seth Vidal 2004-09-22 20:55:54 UTC
I'll add in the __iter__() method to the self.ts instance handing back
self.ts.ts as the iterator. 

Robert, if you can check out cvs after I do that I'd be interested in
the result.

My main confusion is why this is only happening on 2 systems and not
on EVERY system.

afaict, either the ts object is an iterator or it's not.

one more question - there's no chance that  any other yum process or
rpmdb-locking process is existent, is there?


Comment 11 Michael Jennings (KainX) 2004-09-22 21:00:13 UTC
Not on my system, no.  It's running in a qemu instance with nothing
else running.  Very minimal install.


Comment 12 Robert Scheck 2004-09-23 06:50:50 UTC
Seth, I've got no further rpm and/or yum processes running:

[root@devel root]# ps aux | grep rpm 
root      7728  0.0  0.2  3972  696 pts/2    S+   08:46   0:00 grep rpm 
[root@devel root]# ps aux | grep yum 
root      7732  0.0  0.2  3976  688 pts/2    R+   08:47   0:00 grep yum 
[root@devel root]# 

Comment 13 Seth Vidal 2004-09-23 08:26:52 UTC
If you could check out yum-HEAD from cvs now and try it.

I defined an __iter__ method for the transaction wrapper class.


Comment 14 Robert Scheck 2004-09-23 09:21:43 UTC
I did the yum cvs checkout and it works for me now, but I'll keep open
this bug report until I get also an "OK" from Michael, who had also 
the same problem (I think).

Comment 15 Michael Jennings (KainX) 2004-09-23 17:29:47 UTC
This problem is definitely fixed.  Thanks for the quick turn-around Seth.


Comment 16 Seth Vidal 2004-09-23 17:31:04 UTC
fixed in upstream cvs


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