Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158558 - 2.1.2_rc3-r6: KeyError: 'media-libs/libgd-1.8.4-r2'
Summary: 2.1.2_rc3-r6: KeyError: 'media-libs/libgd-1.8.4-r2'
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 147007
  Show dependency tree
 
Reported: 2006-12-19 10:42 UTC by Martin Mokrejš
Modified: 2006-12-20 19:17 UTC (History)
0 users

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


Attachments
fix package move code and automatically handle corruption in the unmerge phase (bug_158558.patch,1.56 KB, patch)
2006-12-19 15:39 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2006-12-19 10:42:59 UTC
Please improve the error messages so the user know which flatfile to fix.


# emerge --unmerge =media-libs/gd-1.8.4-r2

 media-libs/gd
    selected: 1.8.4-r2 
   protected: none
     omitted: 2.0.33 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1 
>>> Unmerging media-libs/gd-1.8.4-r2...
Traceback (most recent call last):
  File "/usr/bin/emerge", line 4934, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 4915, in emerge_main
    mtimedb["ldpath"]):
  File "/usr/bin/emerge", line 3147, in unmerge
    vartree=vartree, ldpath_mtimes=ldpath_mtimes)
  File "/usr/lib/portage/pym/portage.py", line 3586, in unmerge
    ldpath_mtimes=ldpath_mtimes)
  File "/usr/lib/portage/pym/portage.py", line 6341, in unmerge
    self.settings, 0, 0, self.vartree.dbapi)
  File "/usr/lib/portage/pym/portage.py", line 2748, in doebuild_environment
    mysettings.setcpv(mycpv, use_cache=use_cache, mydb=mydbapi)
  File "/usr/lib/portage/pym/portage.py", line 1555, in setcpv
    pkginternaluse = " ".join([x[1:] \
  File "/usr/lib/portage/pym/portage.py", line 4825, in aux_get
    raise KeyError(mycpv)
KeyError: 'media-libs/libgd-1.8.4-r2'
#
# emerge -u world
Calculating world dependencies \


Error occurred while processing media-libs/gd-1.8.4-r2
"invalid atom: ':'"
!!! Depgraph creation failed.
#
# emerge --info
Portage 2.1.2_rc3-r6 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.5-r0, 2.6.18.1 i686)
=================================================================
System uname: 2.6.18.1 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
Gentoo Base System version 1.12.7
Last Sync: Tue, 19 Dec 2006 16:30:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.3.6, 2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="cs cz en"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 FFmpeg X Xaw3d a52 aac aalib acpi alsa amr apache2 apm ati avi berkdb bitmap-fonts bonobo caca cdparanoia cdr cli cpudetection cracklib crypt cscope ctype cups dba dga directfb divx divx5 divx5linux dlloader dri dts dv dvb dvd dvdr dvdread eds elibc_glibc emacs emacs-w3 emboss encode ethereal evo f77 faad faad2 fam fame fbcon ffmpeg flash foomaticdb fortran fvwm fvwm2 gb gd gdbm ggi gif gphoto2 gpm gstreamer gtk gtk2 gtkhtml i8x0 icc iconv ieee1394 ifc imagemagick imlib imlib2 inifile innodb input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog ithreads java jpeg kernel_linux lcms leim libcaca libg++ libwww linguas_cs linguas_cz linguas_en lirc live lzo mad matroska mcal mesa mhash mikmod ming mmx mmx2 mmxext motif mozilla mp3 mpeg mule musepack mysql ncurses network nls nptl nptlonly ogg oggvorbis opengl oss pam pcre pda pdf pdflib perl plotutils plugin png ppds pppd pthread pthreads python qt qt3 qt4 qtx quicktime readline reflection rtc samba scanner scp server session slp spell spl sse sse2 ssl stroke tcltk tcpd tetex theora thread threads tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales v4l v4l2 video_cards_ati vorbis win32 win32codecs winvidix wmf x264 xanim xml xml2 xorg xosd xprint xv xvid xvmc zeo zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS

#
Comment 1 Zac Medico gentoo-dev 2006-12-19 14:07:29 UTC
This should fix it:

mv /var/db/pkg/media-libs/gd-1.8.4-r2/libgd-1.8.4-r2.ebuild /var/db/pkg/media-libs/gd-1.8.4-r2/gd-1.8.4-r2.ebuild
Comment 2 Lisa Seelye (RETIRED) gentoo-dev 2006-12-19 15:15:48 UTC
(In reply to comment #1)
> This should fix it:
> 
> mv /var/db/pkg/media-libs/gd-1.8.4-r2/libgd-1.8.4-r2.ebuild
> /var/db/pkg/media-libs/gd-1.8.4-r2/gd-1.8.4-r2.ebuild
> 

It doesn't fix it for my similar issue with -r7. The solution I used was to remove the offending packages with offending atoms (they're not in portage anymore).
Comment 3 Zac Medico gentoo-dev 2006-12-19 15:39:24 UTC
Created attachment 104403 [details, diff]
fix package move code and automatically handle corruption in the unmerge phase

This patch should solve the traceback.  If it is saved as /tmp/bug_158558.patch then it can be applied as follows:

cd /usr/lib/portage
patch -p0 < /tmp/bug_158558.patch

(In reply to comment #2)
> It doesn't fix it for my similar issue with -r7. The solution I used was to
> remove the offending packages with offending atoms (they're not in portage
> anymore).

Generally, installed packages that have invalid atoms should be unmerged (or reinstalled).
Comment 4 Zac Medico gentoo-dev 2006-12-19 21:16:26 UTC
This has been released in 2.1.2_rc3-r8.
Comment 5 Martin Mokrejš 2006-12-20 01:50:43 UTC
ribosome ~ # cd /usr/lib/portage
ribosome portage # patch -p0 < /tmp/a.patch 
patching file pym/portage.py
Hunk #1 succeeded at 4662 (offset -3 lines).
Hunk #2 succeeded at 6336 (offset -11 lines).
ribosome portage # emerge -uO portage
Calculating dependencies |


Error occurred while processing media-libs/gd-1.8.4-r2
"invalid atom: ':'"
ribosome portage # emerge portage
Calculating dependencies |


Error occurred while processing media-libs/gd-1.8.4-r2
"invalid atom: ':'"
ribosome portage # 
Comment 6 Martin Mokrejš 2006-12-20 01:56:20 UTC
I see, this worked:

emerge --unmerge =media-libs/gd-1.8.4-r2

Still, please improve other cases, like "-u", etc.
Comment 7 Martin Mokrejš 2006-12-20 02:01:16 UTC
Yet another wrong message.

# emerge -uN world
Calculating world dependencies -


Error occurred while processing media-plugins/gst-plugins-mad-0.6.4
"invalid atom: '=gst-plugins-0.6.4*'"
!!! Depgraph creation failed.
#

I made few guesses and the one below was the right one.

# emerge --unmerge =media-plugins/gst-plugins-mad-0.6.4

 media-plugins/gst-plugins-mad
    selected: 0.6.4 
   protected: none
     omitted: 0.8.1 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 

^C
Exiting on signal 2
#
Comment 8 Martin Mokrejš 2006-12-20 02:06:02 UTC
Sorry for the spam, I shouldn't have cancelled it ... Is this the expected behaviour? I have added the missing quote, though.

# emerge --unmerge =media-plugins/gst-plugins-mad-0.6.4

 media-plugins/gst-plugins-mad
    selected: 0.6.4 
   protected: none
     omitted: 0.8.1 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1 
>>> Unmerging media-plugins/gst-plugins-mad-0.6.4...
/var/db/pkg/media-plugins/gst-plugins-mad-0.6.4/gst-plugins-mad-0.6.4.ebuild: line 10: unexpected EOF while looking for matching `"'
/var/db/pkg/media-plugins/gst-plugins-mad-0.6.4/gst-plugins-mad-0.6.4.ebuild: line 12: syntax error: unexpected end of file

!!! ERROR: media-plugins/gst-plugins-mad-0.6.4 failed.
Call stack:
  ebuild.sh, line 1477:   Called die

!!! error sourcing ebuild
!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! FAILED prerm: 1
# vim /var/db/pkg/media-plugins/gst-plugins-mad-0.6.4/gst-plugins-mad-0.6.4.ebuild
ribosome portage # emerge --unmerge =media-plugins/gst-plugins-mad-0.6.4

 media-plugins/gst-plugins-mad
    selected: 0.6.4 
   protected: none
     omitted: 0.8.1 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1 
>>> Unmerging media-plugins/gst-plugins-mad-0.6.4...
No package files given... Grabbing a set.
<<<        obj /usr/lib/gstreamer-0.6/libgstmad.so
<<<        obj /usr/lib/gstreamer-0.6/libgstmad.la
--- !empty dir /usr/lib/gstreamer-0.6
--- !empty dir /usr/lib
--- !empty dir /usr
 * Updating gstreamer plugins registry for gstreamer 0.6 ...
INFO (29821: 0) Initializing GStreamer Core Library version 0.6.4 
INFO (29821: 0) CPU features: (00000000) MMX SSE 
rebuilding global_registry
added plugin gstindexers with 2 feature(s)
added plugin gstoptomegascheduler with 1 feature(s)
added plugin gstbasicgthreadscheduler with 1 feature(s)
added plugin autoplugcache with 1 feature(s)
added plugin gstbasicwingoscheduler with 1 feature(s)
added plugin gstoptgthreadscheduler with 1 feature(s)
added plugin gstputbits with 0 feature(s)
added plugin gstoptscheduler with 1 feature(s)
added plugin gststaticautoplugrender with 1 feature(s)
added plugin autoplugger with 1 feature(s)
added plugin gstbasicomegascheduler with 1 feature(s)
added plugin gsttypes with 2 feature(s)
added plugin gststaticautoplug with 1 feature(s)
added plugin gstoptwingoscheduler with 1 feature(s)
added plugin gstelements with 14 feature(s)
added plugin gstspider with 2 feature(s)
added plugin gstgetbits with 0 feature(s)
added plugin gstbytestream with 0 feature(s)
rebuilding user_registry
loaded 18 plugins with 31 features

 * GNU info directory index is up-to-date.

#
Comment 9 Zac Medico gentoo-dev 2006-12-20 08:21:28 UTC
(In reply to comment #8)
> Sorry for the spam, I shouldn't have cancelled it ... Is this the expected
> behaviour? I have added the missing quote, though.

That's expected if the ebuild is corrupt for some reason.  I suppose we can show a message giving the user some advice in cases like that.
Comment 10 Zac Medico gentoo-dev 2006-12-20 15:10:24 UTC
(In reply to comment #6)
> Still, please improve other cases, like "-u", etc.

It's fixed in svn r5339 to ignore invalid dependencies for packages that are being replaced.
Comment 11 Zac Medico gentoo-dev 2006-12-20 16:38:22 UTC
(In reply to comment #8)
> !!! error sourcing ebuild
> !!! If you need support, post the topmost build error, and the call stack if
> relevant.
> 
> !!! FAILED prerm: 1

In svn r5340 I've added a message telling the user where the ebuild is and advising them that if necessary the ebuild can be removed in order to skip the removal phases.
Comment 12 Zac Medico gentoo-dev 2006-12-20 19:17:53 UTC
This has been released in 2.1.2_rc3-r9.