Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157897 - sys-apps/portage-2.1.2_rc3-r3 - emerge --update --newuse --deep world fails with KeyError
Summary: sys-apps/portage-2.1.2_rc3-r3 - emerge --update --newuse --deep world fails w...
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, REGRESSION
: 158121 (view as bug list)
Depends on:
Blocks: 147007
  Show dependency tree
 
Reported: 2006-12-12 01:57 UTC by Anant Narayanan (RETIRED)
Modified: 2006-12-15 01:29 UTC (History)
2 users (show)

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


Attachments
only let depgraph.create() inject "merge" nodes into the final state dbapi (create_merge.patch,419 bytes, patch)
2006-12-12 03:53 UTC, Zac Medico
Details | Diff
show how the packages got pulled into the dependency graph (show_parents.patch,1.29 KB, patch)
2006-12-15 01:29 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anant Narayanan (RETIRED) gentoo-dev 2006-12-12 01:57:25 UTC
anant@theghost ~ $ emerge --update --newuse --deep -pv world

These are the packages that would be merged, in order:

Calculating world dependencies \Traceback (most recent call last):
  File "/usr/bin/emerge", line 4856, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 4851, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/bin/emerge", line 4179, in action_build
    if not mydepgraph.xcreate(myaction):
  File "/usr/bin/emerge", line 1831, in xcreate
    if not self.validate_blockers():
  File "/usr/bin/emerge", line 1542, in validate_blockers
    slot_atom = "%s:%s" % (portage.dep_getkey(mycpv),
  File "/usr/lib/portage/pym/portage.py", line 4461, in aux_get
    raise KeyError(mycpv)
KeyError: 'sys-apps/dbus-1.0.1-r2'


Here's my emerge --info:

anant@theghost ~ $ emerge --info
Portage 2.1.2_rc3-r3 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo-r2 i686)
=================================================================
System uname: 2.6.18-gentoo-r2 i686 Genuine Intel(R) CPU           T2600  @ 2.16GHz
Gentoo Base System version 1.12.6
Last Sync: Tue, 12 Dec 2006 08:00:01 +0000
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     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=prescott -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"
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=prescott -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer nostrip sandbox sfperms splitdebug strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
MAKEOPTS="-j3"
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="x86 X aalib alsa alsa_cards_hda-intel apache2 arts avahi bash-completion beagle berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups dbus debug dlloader dri dvd dvdr eds elibc_glibc emboss encode esd exif expat fam firefox flac fortran gdbm gif gnome gnutls gpm gstreamer gtk gtk2 hal iconv input_devices_evdev input_devices_keyboard input_devices_mouse input_devices_synaptics ipv6 isdnlog java jpeg kdeenablefinal kernel_linux ldap libcaca libg++ libnotify mad mikmod mmx mono mp3 mpeg mysql ncurses nls nptl nptlonly offensive ogg opengl oss pam pcre perl png postgres ppds pppd python qt3 qt4 quicktime readline reflection samba sdl session spell spl sqlite sse sse2 ssl svg tcpd tetex theora tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l v4l2 video_cards_fglrx video_cards_vesa vorbis win32codecs xinerama xml xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-12-12 02:00:22 UTC
Whooops ;)
Comment 2 Zac Medico gentoo-dev 2006-12-12 03:53:46 UTC
Created attachment 103855 [details, diff]
only let depgraph.create() inject "merge" nodes into the final state dbapi

This patch should correct the problem.  If the patch is saved as /tmp/create_merge.patch then it can be applied as follows:

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

Please test the patch to verify that it corrects the problem for you.  Thanks.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-12-12 03:58:13 UTC
(In reply to comment #2)
> Created an attachment (id=103855) [edit]
> only let depgraph.create() inject "merge" nodes into the final state dbapi

WFM
Comment 4 Zac Medico gentoo-dev 2006-12-12 04:25:29 UTC
Thanks for testing.  It's fixed in svn r5279 and released in 2.1.2_rc3-r4.
Comment 5 Anant Narayanan (RETIRED) gentoo-dev 2006-12-12 04:39:11 UTC
> This patch should correct the problem.  If the patch is saved as
> /tmp/create_merge.patch then it can be applied as follows:

Works like a charm, thanks :)
Comment 6 Zac Medico gentoo-dev 2006-12-12 05:18:22 UTC
I've realized that it's still possible for the same type of error to be triggered by rare cases of bug 1343 where a package is merged twice.  I'll have to detect that case and eliminate the extra package in order for this to really be completely fixed.  It's a pretty rare case, but it's certainly known to occur.
Comment 7 Zac Medico gentoo-dev 2006-12-12 13:51:04 UTC
I plan to solve this by constraining the package matching visibility of the portdbapi and bindbapi instances each time that a package is selected for merge.  That way, any all following selections for a package in the same slot will be constrained to the same result.  The portdbapi and bindbapi classes themselves don't necessarily need to be modified.  All that's needed is something implementing the dbapi interface (something like a fakedbapi instance) and it will only be used for dep_check() calls made inside the depgraph class.
Comment 8 Scott Beck 2006-12-13 10:38:54 UTC
I'm still seeing this error. My emerge already has the changes in this patch.

lappy ~ # emerge -uDpv world

These are the packages that would be merged, in order:

Calculating world dependencies /Traceback (most recent call last):
  File "/usr/bin/emerge", line 4856, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 4851, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/bin/emerge", line 4179, in action_build
    if not mydepgraph.xcreate(myaction):
  File "/usr/bin/emerge", line 1831, in xcreate
    if not self.validate_blockers():
  File "/usr/bin/emerge", line 1542, in validate_blockers
    slot_atom = "%s:%s" % (portage.dep_getkey(mycpv),
  File "/usr/lib/portage/pym/portage.py", line 4461, in aux_get
    raise KeyError(mycpv)
KeyError: 'sys-apps/dbus-1.0.2'
lappy ~ #   
Comment 9 Zac Medico gentoo-dev 2006-12-13 12:30:33 UTC
(In reply to comment #8)
> I'm still seeing this error. My emerge already has the changes in this patch.

You can work around this for now by downgrading to 2.1.2_rc3.  I'm currently testing a patch that solves this I plan to release it in 2.1.2_rc3-r5 later today.
Comment 10 Zac Medico gentoo-dev 2006-12-13 17:17:31 UTC
As of svn r5287 the depgraph is fixed to handle all slot/node collisions.  If a collision occurs that it isn't able to handle, then it will print an informational message something like this:

!!! Multiple versions within a single package slot have been
!!! pulled into the dependency graph:

     sys-apps/dbus-1.0.1-r2
     sys-apps/dbus-1.0.2

It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is all so
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously. If such a conflict exists in the
dependencies of two different packages, then those packages can not be
installed simultaneously.

For more information, see MASKED PACKAGES section in the emerge man page
or refer to the Gentoo Handbook.
Comment 11 Zac Medico gentoo-dev 2006-12-14 00:24:03 UTC
This has been released in 2.1.2_rc3-r5.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2006-12-14 04:08:02 UTC
*** Bug 158121 has been marked as a duplicate of this bug. ***
Comment 13 Zac Medico gentoo-dev 2006-12-15 01:29:05 UTC
Created attachment 104078 [details, diff]
show how the packages got pulled into the dependency graph

With this patch the user will be shown which packages pulled in the conflicting packages so that it will be easier for the user to decide what action to take.  I was going to commit it now but our server seems to be down.  Here is an example of the new output:

!!! Multiple versions within a single package slot have been
!!! pulled into the dependency graph:

('ebuild', '/', 'sys-apps/dbus-0.62-r2', 'merge') pulled in by
   ('ebuild', '/', 'app-text/ghostscript-gpl-8.54', 'merge')

('ebuild', '/', 'sys-apps/dbus-1.0.2', 'merge') pulled in by
   ('ebuild', '/', 'net-print/cups-1.2.7', 'merge')