I type emerge --clean and I get a bunch of stuff like the following: --- !mtime obj ... Then finally the error message comes up: Traceback (most recent call last): File "/usr/bin/emerge", line 3245, in ? if 1 == unmerge(myaction, myfiles, raise_on_missing=False): File "/usr/bin/emerge", line 2469, in unmerge retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"]) File "/usr/lib/portage/pym/portage.py", line 3271, in unmerge mylink.unmerge(trimworld=mytrimworld,cleanup=1) File "/usr/lib/portage/pym/portage.py", line 6018, in unmerge statobj = os.stat(obj) TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str emerge --info is: Portage 2.1-r1 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.6-r4, 2.6.16-gentoo-r7 i686) ================================================================= System uname: 2.6.16-gentoo-r7 i686 AMD Athlon(tm) 2500+ Gentoo Base System version 1.6.15 app-admin/eselect-compiler: [Not Present] dev-lang/python: 2.3.5-r2, 2.4.2, 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -pipe -O2" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo" CXXFLAGS="-march=athlon-xp -pipe -O2" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.cs.lewisu.edu/gentoo/ http://mirrors.acm.cs.rpi.edu/gentoo/" INSTALL_MASK="/etc/apache2" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X alsa apache2 apm arts avi berkdb bitmap-fonts cdr cli crypt cups dlloader dri dvd eds emboss encode ethereal foomaticdb fortran ftp gdbm gif gnome gpm gstreamer gtk gtk2 imlib innodb ipv6 isdnlog java jikes jpeg kde libg++ libwww lm_sensors mad mikmod motif mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pcre pdflib perl png pppd python qt qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts vorbis win32codecs x86 xml xml2 xmms xorg xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I think you've got a corrupt /var/db/pkg/*/*/CATEGORY file for whatever package it was trying to unmerge. If that's the case, you can remove the directory containing the corrupt file and reinstall the package. In svn r3382, I've added some validation of the CATEGORY file and a warning message.
So anything left to do here for us?
*** Bug 163485 has been marked as a duplicate of this bug. ***
In svn r5763 I've added null byte corruption detection for CONTENTS since that seems to be the cause of the traceback in bug #163485.
obj /usr/src/linux-2.6.14-rc2/fs/nfsd/Makefile 93967c98014c8a063dfb5b8a5f658a6c 1127676011 obj /usr/src/linux-2.6.14-rc2/fs/nfsd/nfs2acl.c 71d5795419c2e0@@@@@@@[.~48K worth of NULLs..]@@@@@ fd25288c89fcacc 1127676011 obj /usr/src/linux-2.6.14-rc2/lib/zlib_inflate/infutil.c 78f9e69cea4cc04a68fb1ca32f26984b 1127676011 Thank you. I hate to say it, but Linux isn't perfect and sometimes crashes and sometimes even journaled filesystems break things :)
This has been released in 2.1.2-r3.