Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 344845 - sys-apps/portage-2.1.9.24: regenworld AttributeError: 'AmbiguousPackageName' object has no attribute 'value
Summary: sys-apps/portage-2.1.9.24: regenworld AttributeError: 'AmbiguousPackageName' ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 346909
  Show dependency tree
 
Reported: 2010-11-09 21:23 UTC by Alex Buell
Modified: 2010-11-27 18:25 UTC (History)
1 user (show)

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


Attachments
a minimal test case (ambiguous-test.py,473 bytes, text/plain)
2010-11-12 04:21 UTC, Zac Medico
Details
workaround: handle AttributeError (bug-344845.patch,950 bytes, patch)
2010-11-13 04:13 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buell 2010-11-09 21:23:47 UTC
# regenworld 
add to world: java-virtuals/jmx
Traceback (most recent call last):
  File "/usr/sbin/regenworld", line 95, in <module>
    print("* %s is an ambigous package name, candidates are:\n%s" % (mykey, e))
  File "/usr/lib/portage/pym/portage/exception.py", line 21, in __str__
    if isinstance(self.value, basestring):
AttributeError: 'AmbiguousPackageName' object has no attribute 'value'

What's the fix for this?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-10 16:08:17 UTC
Please post your `emerge --info' in a comment. Also, explain to what purpose you are running regenworld.
Comment 2 Alex Buell 2010-11-10 16:48:59 UTC
 # emerge --info
Portage 2.1.9.24 (default/linux/x86/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.35-gentoo-r7 i686)
=================================================================
System uname: Linux-2.6.35-gentoo-r7-i686-Mobile_Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-1.12.14
Timestamp of tree: Wed, 10 Nov 2010 12:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r1
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -mfpmath=sse -O2 -pipe -fomit-frame-pointer -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=prescott -mfpmath=sse -O2 -pipe -fomit-frame-pointer -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ http://de-mirror.org/distro/gentoo/ ftp://gentoo.imj.fr/pub/gentoo/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=30"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/rion /var/lib/layman/x11 /var/lib/layman/synce /var/lib/layman /var/lib/layman/thebuell"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac acpi alsa amr apache2 asf aspnet2 autoipd automount avahi battstat berkdb bluetooth branding brasero bzip2 cairo cdda cdr cli consolekit cracklib crypt css ctype cups curl custom-optimization cxx dbus dell device-mapper dhcp dhcpcd dri dv dvd dvdr dvdread eds emerald encode evo exchange exif extras faac faad fam ffmpeg firefox flac foomaticdb fortran fts3 fuse gallium gcj gdbm gdu gimpprint glitz glut glx gnome gnome-keyring gnutls gpm gsm gstreamer gtk gtk2 hal hddtemp iconv id3tag imap ipv6 jadetex java jbig jpeg kerberos kpathsea lame laptop latex lcms ldap libnotify logrotate mad matroska mbox mdnsresponder-compat mikmod milter mmx mmxext modules motif mozdevelop mp3 mpeg mpm-worker mppe-mppc mudflap nautilus ncurses networkmanager nls nptl nptlonly nsplugin nvidia objc offensive ogg opengl openmp pam pcre pdf perl png policykit ppds pppd python readline samba sasl sdk sdl session sms spell sqlite sse sse2 ssl ssse3 stream svg sysfs taglib tcpd theora threads tiff timidity truetype unicode usb utf8 v4l v4l2 video vorbis wifi win32codecs x264 x86 xcb xface xine xinerama xml xorg xrandr xsl xulrunner xv xvid zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status udev unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 3 Alex Buell 2010-11-10 16:49:42 UTC
Readding packages that should have been in my world file. 
Comment 4 Alex Buell 2010-11-11 19:31:16 UTC
This bug is also present in all versions of portage > 2.1.8.3. 

It appears related to its inability to handle ambiguous packages names such as cross-i586-pc-linux-gnu/binutils, cross-sparc-unknown-linux-gnu/binutils, sys-devel/binutils. 

Suggest when you test it, ensure you have some cross compilers installed. 
Comment 5 Zac Medico gentoo-dev 2010-11-12 04:21:49 UTC
Created attachment 254057 [details]
a minimal test case

I'm not able to reproduce it (with any version of python). Can you try running this script with 'binutils' as the first argument, and tell me if it triggers the error? Also, does portage have USE=python3 enabled or not?
Comment 6 Alex Buell 2010-11-12 09:17:55 UTC
# regenworld 
Traceback (most recent call last):
  File "/usr/sbin/regenworld", line 95, in <module>
    print("* %s is an ambigous package name, candidates are:\n%s" % (mykey, e))
  File "/usr/lib/portage/pym/portage/exception.py", line 21, in __str__
    if isinstance(self.value, basestring):
AttributeError: 'AmbiguousPackageName' object has no attribute 'value'
# ./testcase.py binutils
* binutils is an ambigous package name, candidates are:
[u'cross-i586-pc-linux-gnu/binutils', u'cross-sparc-unknown-linux-gnu/binutils', u'sys-devel/binutils']
Comment 7 Alex Buell 2010-11-12 09:24:40 UTC
And no, I do not have USE=python3 enabled at all, although python 3.1.2-r4 is installed, it is not used. 

# eselect python list
Available Python interpreters:
  [1]   python2.6 *
  [2]   python3.1
Comment 8 Zac Medico gentoo-dev 2010-11-13 04:13:17 UTC
Created attachment 254169 [details, diff]
workaround: handle AttributeError

Please apply this patch and then run regenworld and post the output.
Comment 9 Alex Buell 2010-11-13 08:07:42 UTC
I can confirm patch fixes the problem. Thanks ;) 
Comment 10 Zac Medico gentoo-dev 2010-11-13 11:49:40 UTC
Can you post the output of regenworld? I'd like to know which package is triggering the problem, and hopefully that will help us to understand what causes the AttributeError.
Comment 11 Alex Buell 2010-11-13 12:52:53 UTC
Here's the output from regenworld:

# regenworld 
* gcc is an ambigous package name
* glibc is an ambigous package name
* libnet is an ambigous package name
* binutils is an ambigous package name
Comment 12 Zac Medico gentoo-dev 2010-11-13 13:21:53 UTC
(In reply to comment #11)
> Here's the output from regenworld:
> 
> # regenworld 
> * gcc is an ambigous package name
> * glibc is an ambigous package name
> * libnet is an ambigous package name
> * binutils is an ambigous package name

Apparently the AttributeError is triggered for all ambiguous packages in regenworld, but it doesn't happen in the minimal test case (as shown in comment #6), even though the code appears to be essentially identical. It's quite puzzling.

Comment 13 Alex Buell 2010-11-13 13:37:33 UTC
It might be a bug in the nderlying db abstraction? 
Comment 14 Zac Medico gentoo-dev 2010-11-13 13:50:10 UTC
Well, in both cases, the AmbiguousPackageName exception is created inside /usr/lib/portage/pym/portage/dbapi/cpv_expand.py. I don't see any way to account for the difference in behavior of the resulting AmbiguousPackageName exceptions.
Comment 15 Zac Medico gentoo-dev 2010-11-25 06:16:21 UTC
The workaround is in 2.2.0_alpha5, but I'll leave this bug open until it's in an unmasked release.
Comment 16 Alex Buell 2010-11-25 17:52:35 UTC
Workaround in portage 2.2.0_alpha5 has been tested and works just fine, thanks. 
Comment 17 Zac Medico gentoo-dev 2010-11-27 18:25:18 UTC
Thanks for testing. This is fixed in 2.1.9.25.