[root@pbigbrother root]# yum clean Gathering header information file(s) from server(s) Server: Fedora Core 1 - i386 - Base Server: Fedora Core 1 - i386 - Released Updates Finding updated packages Cleaning packages and old headers Traceback (most recent call last): File "/usr/bin/yum", line 60, in ? yummain.main(sys.argv[1:]) File "yummain.py", line 251, in main File "clientStuff.py", line 960, in take_action File "clientStuff.py", line 677, in clean_up_old_headers File "clientStuff.py", line 66, in getENVRA TypeError: unsubscriptable object [root@pbigbrother root]# From the strace, it looks like a downloaded header is corrupted and yum clean is puking rather than cleaning it up: open("/var/cache/yum/updates-released/headers/kernel-source-0-2.4.22-1.2135.nptl.i386.hdr", O_RDONLY|O_LARGEFILE) = 6 fstat64(6, {st_mode=S_IFREG|0644, st_size=52901, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbec40000 _llseek(6, 0, [0], SEEK_CUR) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=52901, ...}) = 0 _llseek(6, 49152, [49152], SEEK_SET) = 0 read(6, "\301f\352\232q\322\315W\216\353\361\322[(\33\27b_\347P"..., 3749) = 3749 _llseek(6, 0, [0], SEEK_SET) = 0 read(6, "\37\213\10\10\0\0\0\0\2\377.newheaders/kernel-sou"..., 4096) = 4096 read(6, "C\27r\354\6\27]\330,7\261\245\233\337\\\310\375T\332\37"..., 4096) = 4096 read(6, "h\33]?\2\233~\375\371\306\311\262q\243\347p\215\341\253"..., 4096) = 4096 read(6, "\274\335\216\277\267]\366\313\302\203^\350\25\353\320u"..., 4096) = 4096 read(6, "\274\273\3:\17a\307\376\0\377\'\303\243\265\340\370\24"..., 12288) = 12288 read(6, "\375\310H\336\27\363\205\37\271\337\331\276\34l\200F\336"..., 4096) = 4096 brk(0) = 0x9493000 brk(0x94b8000) = 0x94b8000 read(6, "?\340\34\241\243\27\333a\302\334\333\6\237%\324\217\321"..., 28672) = 20133 read(6, "", 8192) = 0 mmap2(NULL, 155648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbebd2000 brk(0) = 0x94b8000 brk(0) = 0x94b8000 brk(0x94a0000) = 0x94a0000 brk(0) = 0x94a0000 brk(0) = 0x94a0000 brk(0) = 0x94a0000 brk(0x949b000) = 0x949b000 brk(0) = 0x949b000 read(6, "", 65536) = 0 _llseek(6, 49152, [49152], SEEK_SET) = 0 read(6, "\301f\352\232q\322\315W\216\353\361\322[(\33\27b_\347P"..., 3741) = 3741 read(6, "_\371\316\347\3179\352\364", 4096) = 8 close(6) = 0 munmap(0xbec40000, 4096) = 0 munmap(0xbebd2000, 155648) = 0 munmap(0xbebf8000, 147456) = 0 write(2, "Traceback (most recent call last"..., 35Traceback (most recent call last): ) = 35 open("/usr/bin/yum", O_RDONLY|O_LARGEFILE) = 6 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 7 fstat64(7, {st_mode=S_IFREG|0644, st_size=21436, ...}) = 0 mmap2(NULL, 21436, PROT_READ, MAP_SHARED, 7, 0) = 0xbec3b000 close(7) = 0 futex(0x5c3af0, FUTEX_WAKE, 2147483647) = 0 write(2, " File \"/usr/bin/yum\", line 60, "..., 37 File "/usr/bin/yum", line 60, in ? ) = 37 fstat64(6, {st_mode=S_IFREG|0755, st_size=2419, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbec3a000 read(6, "#!/usr/bin/python\n# yum -- Yum r"..., 4096) = 2419 write(2, " ", 4 ) = 4 write(2, "yummain.main(sys.argv[1:])\n", 27yummain.main(sys.argv[1:]) ) = 27 close(6) = 0 munmap(0xbec3a000, 4096) = 0 open("yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)open("/usr/bin/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/yum/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/plat-linux2/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/lib-dynload/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/gtk-2.0/yummain.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"yummain.py\", line 251, i"..., 39 File "yummain.py", line 251, in main ) = 39 open("clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/bin/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/yum/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/plat-linux2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/lib-dynload/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/gtk-2.0/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"clientStuff.py\", line 96"..., 50 File "clientStuff.py", line 960, in take_action ) = 50 open("clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/bin/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/yum/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/plat-linux2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/lib-dynload/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/gtk-2.0/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"clientStuff.py\", line 67"..., 59 File "clientStuff.py", line 677, in clean_up_old_headers ) = 59 open("clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/bin/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/yum/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/plat-linux2/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/lib-dynload/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.2/site-packages/gtk-2.0/clientStuff.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"clientStuff.py\", line 66"..., 46 File "clientStuff.py", line 66, in getENVRA ) = 46 write(2, "TypeError", 9TypeError) = 9 write(2, ": ", 2: ) = 2 write(2, "unsubscriptable object", 22unsubscriptable object) = 22 write(2, "\n", 1 ) = 1 rt_sigaction(SIGINT, NULL, {0xaeb7a0, [], SA_RESTORER, 0x469fb8}, 8) = 0 rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0 brk(0) = 0x949b000 brk(0) = 0x949b000 brk(0x9491000) = 0x9491000 brk(0) = 0x9491000 close(3) = 0 munmap(0xbf53e000, 4096) = 0 close(4) = 0 munmap(0xbf302000, 4096) = 0 munmap(0xbec41000, 2977792) = 0 close(5) = 0 munmap(0xbf14b000, 458752) = 0 munmap(0xbf1bb000, 1318912) = 0 munmap(0xbf2fd000, 16384) = 0 rt_sigprocmask(SIG_BLOCK, ~[RTMIN], [], 8) = 0 rt_sigaction(SIGHUP, {SIG_DFL}, NULL, 8) = 0 rt_sigaction(SIGINT, {0x809f070, [], SA_RESTORER, 0x469fb8}, NULL, 8) = 0 rt_sigaction(SIGTERM, {SIG_DFL}, NULL, 8) = 0 rt_sigaction(SIGQUIT, {SIG_DFL}, NULL, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 munmap(0xbf301000, 4096) = 0 exit_group(1) = ?
Is this a general problem or just a single case? If single, not all forms of corruption can be unambiguously detected.
I'd say this is a single case of a general problem. I get these sorts of errors regularly when I do my yum update ; yum clean cycle. Manually deleting the header usually fixes, but it'd be nice if yum didn't puke / yum clean would actually work
Created attachment 96692 [details] bad header i've attached the bad header. I'm using a web proxy on that particular box, which probably doesn't help matters ;-)
Can you start saving the headers? No way to fix otherwise. FWIW, there are insufficient constraints on rpm header data to unambiguously detect errors, that's why header SHA1 was added. There are still packages around that do not have header SHA1 data. There are also implementations that disable the check for performance. If you get 5-10 headers with errors, I will take a look. Perhaps there's a few more tweaks that can be done. Reopen this bug then, worksforme as in cd /var/cache/yum/*/headers rm -f *
Okay. From what I can tell the general corruption I'm seeing is truncated headers. I suspect it's something like 1. someone on proxy runs yum, interrupts it 2. proxy caches incomplete header 3. I run yum, get bad header from proxy 4. yum doesn't detect truncation and Bad Things happen If that's the scenario, the real problem is steps 1-2, but it'd be nice if yum could detect the truncation and give a more user-friendly error than a traceback. Of course, if it can't, it can't....
I just got this running yum-2.0.7-1.1 on kernel 2.6.7-1.494.2.2: # yum clean Gathering header information file(s) from server(s) Server: Fedora Core 2 - i386 - Base Server: Fedora Core 2 - i386 - Released Updates Finding updated packages Cleaning packages and old headers Damaged Header /var/cache/yum/updates-released/headers/kernel-sourcecode-0-2.6.6-1.435.2.1.noarch.hdr Traceback (most recent call last): File "/usr/bin/yum", line 30, in ? yummain.main(sys.argv[1:]) File "/usr/share/yum/yummain.py", line 296, in main HeaderInfo, rpmDBInfo, obsoleted) File "/usr/share/yum/clientStuff.py", line 1156, in take_action clean_up_old_headers(rpmDBInfo, HeaderInfo) File "/usr/share/yum/clientStuff.py", line 772, in clean_up_old_headers (e, n, v, r, a) = getENVRA(hdr) File "/usr/share/yum/clientStuff.py", line 67, in getENVRA if header[rpm.RPMTAG_EPOCH] == None: TypeError: unsubscriptable object