Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 149134

Summary: Portage needs to handle invalid cache properly
Product: Portage Development Reporter: Doug Goldstein (RETIRED) <cardoe>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: carlo
Priority: High Keywords: InVCS, REGRESSION
Version: 2.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 147007    
Attachments: bad cache file
catch a ValueError caused by corrupt cache

Description Doug Goldstein (RETIRED) gentoo-dev 2006-09-25 21:41:44 UTC
I just updated to sys-apps/portage-2.1.2_pre1-r2. And repoman broke for me with the following backtrace:

Traceback (most recent call last):
  File "/usr/bin/repoman", line 1180, in ?
    trees=trees)
  File "/usr/lib/portage/pym/portage.py", line 3550, in dep_check
    mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache)
  File "/usr/lib/portage/pym/portage.py", line 3587, in dep_wordreduce
    mydep=mydbapi.xmatch(mode,deplist[mypos])
  File "/usr/lib/portage/pym/portage.py", line 5146, in xmatch
    myval=match_from_list(mydep,self.xmatch("list-visible",None,mydep=mydep,mykey=mykey))
  File "/usr/lib/portage/pym/portage.py", line 5132, in xmatch
    myval=self.gvisible(self.visible(self.cp_list(mykey)))
  File "/usr/lib/portage/pym/portage.py", line 5231, in gvisible
    keys, eapi = self.aux_get(mycpv, ["KEYWORDS", "EAPI"])
  File "/usr/lib/portage/pym/portage.py", line 4846, in aux_get
    mydata = self.auxdb[mylocation][mycpv]
  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/flat_hash.py", line 40, in _parse_data
    d = dict(map(lambda x:x.rstrip().split("=", 1), data))
ValueError: dictionary update sequence element #0 has length 1; 2 is required


jstubbs had me add a print statement in there and it was from /var/cache/edb/dep/home/cardoe/workspace/gentoo-x86/app-crypt/gnupg-1.4.2-r1 which is my CVS (which isn't in PORTDIR_OVERLAY by default) and I'll attach the file here.
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2006-09-25 21:42:17 UTC
Created attachment 98092 [details]
bad cache file
Comment 2 Zac Medico gentoo-dev 2006-09-27 16:47:32 UTC
*** Bug 149360 has been marked as a duplicate of this bug. ***
Comment 3 Zac Medico gentoo-dev 2006-09-27 17:18:25 UTC
Created attachment 98272 [details, diff]
catch a ValueError caused by corrupt cache

This is fixed in svn r4545.
Comment 4 Zac Medico gentoo-dev 2006-09-29 16:49:28 UTC
This has been released in 2.1.2_pre2.