Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100444 - [PATCH] Portage crashes when updating cache
Summary: [PATCH] Portage crashes when updating cache
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 96410 105332 105943 105951 107097 109674 113416 118536 118921 120276 123372 (view as bug list)
Depends on:
Blocks: 106648 108082
  Show dependency tree
 
Reported: 2005-07-27 01:49 UTC by Priit Laes (IRC: plaes)
Modified: 2006-02-19 06:16 UTC (History)
15 users (show)

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


Attachments
portage-2.0.51.22-emerge-cleanse_cache-has_key(cat).patch (portage-2.0.51.22-emerge-cleanse_cache-has_key(cat).patch,1.32 KB, patch)
2005-07-28 18:30 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes (IRC: plaes) 2005-07-27 01:49:56 UTC
emalaev metadata # emerge metadata
skipping sync

>>> Updating Portage cache:    7%Traceback (most recent call last):
  File "/usr/bin/emerge", line 2718, in ?
    cleanse_cache(oldcat, savelist)
  File "/usr/bin/emerge", line 2701, in cleanse_cache
    portage.db["/"]["porttree"].dbapi.auxdb[porttree_root][cat].clear()
KeyError: 'app-dicts'

I have app-dicts/ in my rsync_excludes file, but /usr/portage
 contains app-dicts directory containing only empty package dirs... 

Reproducible: Always
Steps to Reproduce:
IIRC when I was setting up rsync_excludes:
1. I deleted the app-dicts directory...
2. started emerge and saw that app-dicts dir was being downloaded
3. stopped emerge and added app-dicts/ into my rsync_excludes file)
4. emerged again and voila...



emalaev app-dicts # emerge info
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.5-r0, 2.6.12-gentoo-r6 i686)
=================================================================
System uname: 2.6.12-gentoo-r6 i686 VIA Ezra
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i586-pc-linux-gnu"
CFLAGS="-Os -march=c3 -pipe -mmmx -m3dnow"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=c3 -pipe -mmmx -m3dnow"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.linux.ee/pub/gentoo/distfiles/
ftp://ftp.du.se/pub/os/gentoo ftp://mirror.pudas.net/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 alsa apache2 apm arts avi berkdb bitmap-fonts boundschecking bzip2
crypt cups emboss encode erandom exif foomaticdb ftp gd gdbm gif gnome gtk2
hardened imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg mysql
ncurses nls nptl nptlonly oggvorbis opengl oss pam pdflib perl php pic png
python qt quicktime readline sdl ssl tcpd tiff truetype truetype-fonts
type1-fonts unicode utf8 vhosts xml2 xmms xv zlib userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Zac Medico gentoo-dev 2005-07-28 18:30:24 UTC
Created attachment 64585 [details, diff]
portage-2.0.51.22-emerge-cleanse_cache-has_key(cat).patch

We are trying to cleanse_cache() a category or package that does not exist in
the cache.  It should be safe to make cleanse_cache() a "no op" in cases where
there is nothing to be cleansed.
Comment 2 Brian Harring (RETIRED) gentoo-dev 2005-08-04 21:12:38 UTC
variation of this I just commited (catch and discard KeyError exception)
Comment 3 Zac Medico gentoo-dev 2005-09-08 22:27:14 UTC
*** Bug 105332 has been marked as a duplicate of this bug. ***
Comment 4 Zac Medico gentoo-dev 2005-09-08 22:29:49 UTC
(In reply to comment #2)
> variation of this I just commited (catch and discard KeyError exception)

There is still a KeyError thrown from another part of cleanse_cache in
portage-2.0.52-r1 (see bug 105332).
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-09-14 04:02:39 UTC
*** Bug 105951 has been marked as a duplicate of this bug. ***
Comment 6 Zac Medico gentoo-dev 2005-09-14 05:30:55 UTC
*** Bug 105943 has been marked as a duplicate of this bug. ***
Comment 7 Brian Harring (RETIRED) gentoo-dev 2005-09-22 00:24:41 UTC
*** Bug 106864 has been marked as a duplicate of this bug. ***
Comment 8 Brian Harring (RETIRED) gentoo-dev 2005-09-22 00:29:06 UTC
*** Bug 96410 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2005-09-24 10:37:13 UTC
*** Bug 107097 has been marked as a duplicate of this bug. ***
Comment 10 Jason Stubbs (RETIRED) gentoo-dev 2005-10-04 08:39:21 UTC
This is fixed in portage-2.0.53_rc3. 
Comment 11 Carsten Lohrke (RETIRED) gentoo-dev 2005-10-18 05:30:28 UTC
*** Bug 109674 has been marked as a duplicate of this bug. ***
Comment 12 Zac Medico gentoo-dev 2005-11-23 17:59:12 UTC
*** Bug 113416 has been marked as a duplicate of this bug. ***
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2006-01-10 08:07:05 UTC
*** Bug 118536 has been marked as a duplicate of this bug. ***
Comment 14 Marek Krolikowski 2006-01-11 04:28:24 UTC
1. boot from LiveCD & others
2. chroot /mnt/gentoo /bin/bash
3. env-update
4. source /etc/profile
5. export PS1="(chroot) $PS1"
6. patch the emerge file
6. emerge sync

>>> Updating Portage cache:
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2706, in ?
    oldcat = portage.catsplit(cp_list[0])[0]
IndexError: list index out of range

new emerge file size is:
-rwxr-xr-x  1 root root 109515 Jan 11 12:00 /usr/lib/portage/bin/emerge

I think patch not working...

Greets
Comment 15 Zac Medico gentoo-dev 2006-01-11 05:18:29 UTC
(In reply to comment #14)
> I think patch not working...

The cache update is not absolutely critical, so after the error occurs, emerge will still allow you upgrade to portage-2.0.53 or higher.  `emerge -u portage && emerge --metadata`
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2006-01-13 13:57:50 UTC
*** Bug 118921 has been marked as a duplicate of this bug. ***
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-01-25 03:20:14 UTC
*** Bug 120276 has been marked as a duplicate of this bug. ***
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2006-02-19 06:16:23 UTC
*** Bug 123372 has been marked as a duplicate of this bug. ***