Description of problem: # sudo yum update Loaded plugins: downloadonly, fastestmirror, presto, refresh-packagekit Loading mirror speeds from cached hostfile * fedora: mirrors.linux.edu.lv * livna: rpm.livna.org * rpmfusion-free: download1.rpmfusion.org * rpmfusion-free-updates: download1.rpmfusion.org * rpmfusion-nonfree: download1.rpmfusion.org * rpmfusion-nonfree-updates: download1.rpmfusion.org * updates: ftp.stw-bonn.de Setting up Update Process Traceback (most recent call last): File "/usr/bin/yum", line 29, in <module> yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 254, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 109, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 356, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 204, in doCommand return base.updatePkgs(extcmds) File "/usr/share/yum-cli/cli.py", line 625, in updatePkgs self.update() File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3179, in update tx_return.extend(self.update(po=self.getPackageObject(new))) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3328, in update available_pkg, updated_pkg) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3135, in _add_up_txmbr if ('reason' in ipkg.yumdb_info and ipkg.yumdb_info.reason == 'dep'): File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 1386, in __getattr__ return self._read(attr) File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 1364, in _read raise AttributeError, "%s has no attribute %s" % (self, attr) AttributeError: <yum.rpmsack.RPMDBAdditionalDataPackage object at 0x3d46610> has no attribute reason Version-Release number of selected component (if applicable): yum-3.2.27-3.fc12.noarch How reproducible: Always Steps to Reproduce: 1. sudo yum update Actual results: Stack trace. Expected results: Updates should be applied. Additional info:
As far as I can see, this is "impossible": if ('reason' in ipkg.yumdb_info and ipkg.yumdb_info.reason == 'dep'): File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 1386, in __getattr__ return self._read(attr) File "/usr/lib/python2.6/site-packages/yum/rpmsack.py", line 1364, in _read raise AttributeError, "%s has no attribute %s" % (self, attr) ...so it'd be nice if reality complied.
AFAICT this can happen if something removed the attribute file after it was read into cache. Unless of course that's what you're referring to as "impossible" :)
The problem is that the "'reason' in ipkg.yumdb_info" should only return true if reason can be loaded and is now in the cache ... but then milliseconds later the "ipkg.yumdb_info.reason" fails, which means it's not in the cache and can't be loaded. I guess we could use .get() instead, but it'd be nice to know why the impossible is happening :).
I can reproduce the problem every time, so if there's any further information I can provide, I'd be happy to do so. I'd also like to know why it's happening. (It started only a few days ago.)
Ok, cool ... didn't realize that :). Does it happen with all update operations, or only when you update some packages? Can you alter these lines in /usr/lib/python2.6/site-packages/yum/rpmsack.py (at line 1364): old: fn = self._mydir + '/' + attr if not os.path.exists(fn): raise AttributeError, "%s has no attribute %s" % (self, attr) new: fn = self._mydir + '/' + attr print "DBG:", fn if not os.path.exists(fn): raise AttributeError, "%s has no attribute %s" % (self, attr) ...then when it prints out can you run: ls -ls <path-from-above>
(In reply to comment #5) > > Does it happen with all update operations, or only when you update some > packages? > I tried, e.g., 'yum update setup' and got the same stack trace. > Can you alter these lines in /usr/lib/python2.6/site-packages/yum/rpmsack.py > (at line 1364): > > > old: > > fn = self._mydir + '/' + attr > if not os.path.exists(fn): > raise AttributeError, "%s has no attribute %s" % (self, attr) > > new: > > fn = self._mydir + '/' + attr > print "DBG:", fn > if not os.path.exists(fn): > raise AttributeError, "%s has no attribute %s" % (self, attr) > > ...then when it prints out can you run: > > ls -ls <path-from-above> # ls -ls /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/reason ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/reason: Input/output error WTF? # ls -l /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/ ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/command_line: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/releasever: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/checksum_type: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/from_repo_revision: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/from_repo: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/reason: Input/output error ls: cannot access /var/lib/yum/yumdb/n/13186d04498f1313e89785c8fd1f108f04aefd65-nss-softokn-freebl-3.12.4-17.fc12-x86_64/checksum_data: Input/output error total 24 drwxr-xr-x. 2 root root 4096 2010-05-09 00:51 ./ drwxr-xr-x. 77 root root 16384 2010-05-14 18:27 ../ -?????????? ? ? ? ? ? checksum_data -?????????? ? ? ? ? ? checksum_type -?????????? ? ? ? ? ? command_line -?????????? ? ? ? ? ? from_repo -?????????? ? ? ? ? ? from_repo_revision -rw-r--r--. 1 root root 10 2010-05-09 00:51 from_repo_timestamp -?????????? ? ? ? ? ? reason -?????????? ? ? ? ? ? releasever Ok, that's disturbking.
umm. maybe it's time to run an fsck on this disk.
Ok, yeh ... I've submitted a "fix" to yum which will make this fail in a much better way (atm. we basically do readdir() on the test part, so that can work even though open() doesn't). But, as Seth said, your FS is really not happy.
(In reply to comment #7) > umm. maybe it's time to run an fsck on this disk. Indeed. That's a hell of a way to discover it. After doing fsck twice, yum update works. No clue what happend to my FS. Thanks for pointing me in the right direction, and for the improved error message.