Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196680 - emerge --metadata => package is corrupt
Summary: emerge --metadata => package is corrupt
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 194041
  Show dependency tree
 
Reported: 2007-10-21 23:56 UTC by Swoög
Modified: 2007-10-23 17:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
complete Traceback (traceback,1.07 KB, text/plain)
2007-10-22 00:00 UTC, Swoög
Details
Emerge --info (emerge-info,3.35 KB, text/plain)
2007-10-22 01:00 UTC, Swoög
Details
handle the CacheCorruption error (cache.patch,369 bytes, patch)
2007-10-22 03:57 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Swoög 2007-10-21 23:56:54 UTC
Hi there !

I get the same since a few times :
Each time I do a emerge --metadata (or a emerge --sync), I have a traceback, with the error :

cache.cache_errors.CacheCorruption: media-fonts/culmus-0.101-r1 is corrupt: dictionary update sequence element #0 has length 1; 2 is required


every time on the same package... I've tried to remove the package (in /usr/portage), remove the cache (/var/cache/edb/dep AND /var/portage/metadata/cache), run emerge --regen (Segfault after some other random package, and the, no more emerge --metadata possible (It just do nothing... Doesn't even display the '1%' step... just freeze...), having an fsck done on my partition/disk (no bad sector or anything else)

I'll join my emerge --info and the complete traceback... It'd be great if anyone could have some ideas...

++
Comment 1 Swoög 2007-10-22 00:00:37 UTC
Created attachment 134092 [details]
complete Traceback
Comment 2 Zac Medico gentoo-dev 2007-10-22 00:22:32 UTC
You didn't say which version of portage you're using but I'm pretty sure this is fixed already.
Comment 3 Zac Medico gentoo-dev 2007-10-22 00:23:37 UTC
This should solve it for you:

rm -rf /var/cache/edb/dep
emerge --metadata
emerge portage
Comment 4 Swoög 2007-10-22 01:00:12 UTC
Created attachment 134095 [details]
Emerge --info
Comment 5 Swoög 2007-10-22 01:04:36 UTC
Sorry, it seems that I forgot to put the emerge-info file...

So, it's Portage v2.1.3.9 (the last one)...

And as I had said :

"I've tried to [...]remove the cache (/var/cache/edb/dep[...]"
I had already tried that and nothing more happened... the same about (re)-emerging portage...
Comment 6 Zac Medico gentoo-dev 2007-10-22 03:57:42 UTC
Created attachment 134098 [details, diff]
handle the CacheCorruption error

If this patch is saved as /tmp/cache.patch then it can be applied as follows:

patch /usr/lib/portage/pym/cache/util.py < /tmp/cache.patch
Comment 7 Swoög 2007-10-22 04:14:23 UTC
Perfect, it worked !

Thank you !
Comment 8 Zac Medico gentoo-dev 2007-10-23 01:40:43 UTC
Anybody else who gets a traceback like this one should note that the error is triggered by one of the files inside ${PORTDIR}/metadata/cache/. In most cases it should serve as a workaround to remove that directory and run emerge --sync again.

>>> Updating Portage cache:   56%Traceback (most recent call last):
  File "/usr/bin/emerge", line 6474, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 6431, in emerge_main
    action_metadata(settings, portdb, myopts)
  File "/usr/bin/emerge", line 5036, in action_metadata
    eclass_cache=ec, verbose_instance=noise_maker)
  File "/usr/lib/portage/pym/cache/util.py", line 31, in mirror_cache
    try:        entry = src_cache[x]
  File "/usr/lib/portage/pym/cache/metadata.py", line 32, in __getitem__
    return flat_hash.database.__getitem__(self, cpv)
  File "/usr/lib/portage/pym/cache/flat_hash.py", line 28, in __getitem__
    d = self._parse_data(myf, cpv)
  File "/usr/lib/portage/pym/cache/metadata.py", line 39, in _parse_data
    d = flat_hash.database._parse_data(self, data, cpv)
  File "/usr/lib/portage/pym/cache/flat_hash.py", line 46, in _parse_data
    raise cache_errors.CacheCorruption(cpv, e)
Comment 9 Zac Medico gentoo-dev 2007-10-23 17:29:31 UTC
This has been released in 2.1.3.16.