Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 603826

Summary: sys-apps/portage-2.3.0: AttributeError: '_pkg_str' object has no attribute 'repo' during global updates
Product: Portage Development Reporter: Benjamin Schindler <beschindler>
Component: CoreAssignee: Portage team <dev-portage>
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 611328    

Description Benjamin Schindler 2016-12-27 10:53:16 UTC
Since I synced a little while ago, I'm unable to do anything with emerge. While running global updates, I get this stacktrace: 

metis benjamin # emerge -u okular

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
  p='update /etc/portage/package.*'
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.4/site-packages/_emerge/", line 1185, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.4/site-packages/_emerge/", line 2771, in run_action
    quiet=("--quiet" in emerge_config.opts)):
  File "/usr/lib64/python3.4/site-packages/portage/", line 41, in _global_updates
    quiet=quiet, if_mtime_changed=if_mtime_changed)
  File "/usr/lib64/python3.4/site-packages/portage/", line 169, in _do_global_updates
    moves = bindb.move_ent(update_cmd, repo_match=repo_match)
  File "/usr/lib64/python3.4/site-packages/portage/dbapi/", line 410, in move_ent
    and not repo_match(mycpv.repo):
AttributeError: '_pkg_str' object has no attribute 'repo'

I opened and inspected the mycpv variable, and got this output: 

Now, kdelibs-3.4.3-r1 is arguably _very_ old and I have no clue where it is coming from. This is a box that was installed somewhere when the first 64bit processors from amd came around and was kept uptodate with gentoo ever since (including hardware upgrades) :). 

Emerge --info: 

metis benjamin # emerge --info
Portage 2.3.0 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-5.4.0, glibc-2.22-r4, 4.4.21-gentoo x86_64)
System uname: Linux-4.4.21-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.3
KiB Mem:    16432384 total,  11203316 free
KiB Swap:      80320 total,     80320 free
Timestamp of repository gentoo: Mon, 26 Dec 2016 11:00:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.3_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.7.1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

ACCEPT_LICENSE="* -@EULA ut2003 dlj-1.1 skype-eula googleearth AdobeFlash-10.3 Oracle-BCLA-JavaSE skype- AdobeFlash-11.x NVIDIA-CUDA"
CFLAGS="-O2 -pipe -march=native"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-O2 -pipe -march=native"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" rsync://"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X a52 aac accessibility acl acpi alsa amd64 avahi bash-completion berkdb branding bzip2 cairo cdda cdparanoia cdr chm cli cmake colord cracklib crypt cscope cups curl cxx daap dbus declarative dri dts dvd dvdr dvdread egl emboss enblend encode evdev exif fam ffmpeg fftw firefox flac fontconfig fortran ftp gdbm geolocation gif gimp git glamor gnome gnome-keyring gold gphoto2 gpm graphite graphviz gstreamer gtk gtk2 gudev hddtemp history hwdb iconv icu imagemagick imap introspection ipv6 jpeg kde kipi kpathsea latex lcms ldap legacy-systray libnotify lldb lm_sensors lto mad mercurial mikmod mmx mmxext mng mod modules mozdevelop moznocompose moznoirc moznomail mozsvg mp3 mp4 mpeg mplayer mtp multilib ncurses nls nogcj nptl nsplugin ogg oggvorbis openal opencl openexr opengl openmp pam pango pch pcre pdf perl phonon plasma png policykit ppds pulseaudio python qml qt3support qt4 qt5 readline resolvconf samba scanner sdl seccomp semantic-desktop session sift spell sql sse sse2 sse3 sse4_1 ssl startup-notification subversion svg systemd tcpd theora threads tiff transcode truetype udev udisks unicode upnp upower usb v4l vim-syntax visualization vorbis wayland webkit widgets wlm wmf wxwidgets x264 xattr xcb xcomposite xinerama xml xmp xpm xscreensaver xv xvid zeroconf zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="nv nvidia" 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"

If you need any more info, let me know
Comment 1 Benjamin Schindler 2016-12-27 12:18:18 UTC
Of course, when I post a bugreport, I also find its cause minutes later. It turned out, that I had really old packages lying around in /usr/portage/packages. eclean packages did the trick. 

But it would be nice if portage could handle such a situation a bit more gracefully than throwing its hands in the air :)
Comment 4 Zac Medico gentoo-dev 2017-05-20 18:09:42 UTC
Fixed in portage-2.3.5.