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

Bug 919819

Summary: Portage crashes with ImportError: cannot import name 'SignedPackage' from 'portage.exception' (/usr/lib/python3.11/site-packages/portage/exception.py)
Product: Portage Development Reporter: Sam James <sam>
Component: Binary packages supportAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: exception.py

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-13 20:39:07 UTC
On an `emerge -pev @world` on this machine, I got a package list, and then an exception:
```
[...]
[ebuild   R    ] gnome-base/gnome-core-apps-41.3:3.0::gentoo  USE="bluetooth cups" 0 KiB
[ebuild   R    ] gnome-base/gnome-40.0-r1:2.0::gentoo  USE="accessibility bluetooth classic cups extras" 0 KiB

Total: 2557 packages (157 upgrades, 1 downgrade, 3 new, 6 in new slots, 2390 reinstalls), Size of downloads: 1200 KiB

WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:

dev-cpp/abseil-cpp:0

  (dev-cpp/abseil-cpp-20230802.0:0/20230802::gentoo, ebuild scheduled for merge) USE="-test" conflicts with
    =dev-cpp/abseil-cpp-20230125.3*:= required by (net-libs/grpc-1.57.0-r1:0/34.157::gentoo, ebuild scheduled for merge) USE="systemd -doc -examples -test"
    ^                   ^^^^^^^^^^^


Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/emerge", line 57, in main
    retval = emerge_main()
             ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/main.py", line 1306, in emerge_main
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 4023, in run_action
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 678, in action_build
    retval = mergetask.merge()
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 1089, in merge
    rval = self._handle_self_update()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 357, in _handle_self_update
    _prepare_self_update(self.settings)
  File "/usr/lib/python3.11/site-packages/portage/package/ebuild/doebuild.py", line 3175, in _prepare_self_update
    lines.append("")
  File "/usr/lib/python3.11/site-packages/portage/proxy/lazyimport.py", line 35, in _preload_portage_submodules
    __import__(name)
  File "/usr/lib/python3.11/site-packages/portage/gpkg.py", line 26, in <module>
    from portage.exception import (
ImportError: cannot import name 'SignedPackage' from 'portage.exception' (/usr/lib/python3.11/site-packages/portage/exception.py)
```

----

# emerge --info
Portage 3.0.57 (python 3.11.7-final-0, default/linux/arm64/17.0/hardened, gcc-14, glibc-2.38-r7, 5.15.134-gentoo-dist aarch64)
=================================================================
System uname: Linux-5.15.134-gentoo-dist-aarch64-with-glibc2.38
KiB Mem:   262955360 total, 138737004 free
KiB Swap:    9767620 total,   9625796 free
Timestamp of repository gentoo: Wed, 13 Dec 2023 19:32:04 +0000
sh dash 0.5.12
ld GNU ld (Gentoo 2.41 p2) 2.41.0
ccache version 4.8.3 [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2::gentoo
dev-lang/python:           3.10.13::gentoo, 3.11.7::gentoo, 3.12.1::gentoo
dev-lang/rust-bin:         1.74.1::gentoo
dev-util/ccache:           4.8.3::gentoo
dev-util/cmake:            3.28.0::gentoo
dev-util/meson:            1.3.0-r2::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255-r1::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.69-r9::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.5::gentoo
sys-devel/gcc:             10.5.0::gentoo, 11.4.1_p20231207::gentoo, 12.3.1_p20230825::gentoo, 13.2.1_p20231014::gentoo, 14.0.0.9999::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo, 17.0.5::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

Installed sets: @sam
ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="*"
CBUILD="aarch64-unknown-linux-gnu"
CFLAGS="-O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3"
CHOST="aarch64-unknown-linux-gnu"
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/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --complete-graph"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live clean-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles multilib-strict news parallel-fetch pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
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"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac accessibility acl acpi activities alsa arm64 bluetooth branding brotli bzip2 cairo cdda cdr cli colord crypt cups dbus declarative dot dri dts dvdr encode exif flac fortran gdbm gif gpm gtk gui hardened http http2 iconv icu ipv6 jadetex jpeg kde kwallet lcms libnotify libtirpc libxml2 lua lz4 lzma mad mng mp3 mp4 mpeg ncurses networkmanager nls nptl ogg opengl openmp opus pam pango pcre pcre32 pdf perl pic pie pim pipewire plasma png policykit ppds pulseaudio python qml qt5 readline ruby screencast sdk sdl seccomp semantic-desktop snappy sound spell sql sqlite ssh ssl ssp startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wayland webchannel webengine webkit widgets wifi wireless wxwidgets x264 xattr xcb xft xml xtpax xv xvid zlib zstd" ADA_TARGET="gnat_2021" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v8" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11 python3_10" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="fbdev dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SHELL, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Zac Medico gentoo-dev 2023-12-13 21:35:40 UTC
(In reply to Sam James from comment #0)
> On an `emerge -pev @world` on this machine, I got a package list, and then
> an exception:

Shouldn't happen with -p because Scheduler.py has this:

    _opts_no_self_update = frozenset(
        ["--buildpkgonly", "--fetchonly", "--fetch-all-uri", "--pretend"]
    )

> ```
> [...]
> [ebuild   R    ] gnome-base/gnome-core-apps-41.3:3.0::gentoo  USE="bluetooth
> cups" 0 KiB
> [ebuild   R    ] gnome-base/gnome-40.0-r1:2.0::gentoo  USE="accessibility
> bluetooth classic cups extras" 0 KiB
> 
> Total: 2557 packages (157 upgrades, 1 downgrade, 3 new, 6 in new slots, 2390
> reinstalls), Size of downloads: 1200 KiB
> 
> WARNING: One or more updates/rebuilds have been skipped due to a dependency
> conflict:
> 
> dev-cpp/abseil-cpp:0
> 
>   (dev-cpp/abseil-cpp-20230802.0:0/20230802::gentoo, ebuild scheduled for
> merge) USE="-test" conflicts with
>     =dev-cpp/abseil-cpp-20230125.3*:= required by
> (net-libs/grpc-1.57.0-r1:0/34.157::gentoo, ebuild scheduled for merge)
> USE="systemd -doc -examples -test"
>     ^                   ^^^^^^^^^^^
> 
> 
> Traceback (most recent call last):
>   File "/usr/lib/python-exec/python3.11/emerge", line 57, in main
>     retval = emerge_main()
>              ^^^^^^^^^^^^^
>   File "/usr/lib/python3.11/site-packages/_emerge/main.py", line 1306, in
> emerge_main
>   File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 4023, in
> run_action
>   File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 678, in
> action_build
>     retval = mergetask.merge()
>              ^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 1089,
> in merge
>     rval = self._handle_self_update()
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 357,
> in _handle_self_update
>     _prepare_self_update(self.settings)
>   File
> "/usr/lib/python3.11/site-packages/portage/package/ebuild/doebuild.py", line
> 3175, in _prepare_self_update
>     lines.append("")

Something weird is going on with this file because _prepare_self_update should start on line 3200 since bug 913628:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=af550b8b5cb91f27b26d6800c3b4cdd2d86a46e6
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-13 21:39:40 UTC
Created attachment 879285 [details]
exception.py

It's truncated!

The screen backlog in this session is too short (will fix that now) so I have no idea what happened. No bad build.log or anything, which makes sense if it got interrupted later on or corrupted :(
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-13 21:41:28 UTC
Will call it INVALID for now unless I can find some more info about how it happened...