Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 872116 - dev-util/pkgdev: pkgcore.config.errors.ConfigurationError: Collapsing defaults for 'domain'
Summary: dev-util/pkgdev: pkgcore.config.errors.ConfigurationError: Collapsing default...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PkgCore (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Arthur Zamarin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-21 01:58 UTC by Julien
Modified: 2022-11-01 23:15 UTC (History)
4 users (show)

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


Attachments
/etc/portage content (etcportage.tar.xz,13.27 KB, application/octet-stream)
2022-09-30 16:02 UTC, Julien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien 2022-09-21 01:58:07 UTC
Running any pkgdev command (except --help) results in an error.
I tried re-emerging it, running as either user or root, deleting my ~/.config/pkgdev/pkgdev.conf, but the error is always reproducible.

~/git/guru $ pkgcheck scan --net
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 419, in collapse_named_section
    result = self.collapse_section(section_stack, name)
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 499, in collapse_section
    collapsed = CollapsedConfig(type_obj, self._render_config_stack(type_obj, config_stack),
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 521, in _render_config_stack
    raise errors.ConfigurationError(f'Type of {key!r} unknown')
pkgcore.config.errors.ConfigurationError: Type of 'connection_timeout' unknown

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 571, in get_default
    defaults = self.types.get(type_name, {}).items()
  File "/usr/lib/python3.10/site-packages/snakeoil/klass.py", line 176, in __get__
    obj = self.function(instance)
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 509, in types
    obj = self.collapse_named_section(name)
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 424, in collapse_named_section
    raise errors.ConfigurationError(
pkgcore.config.errors.ConfigurationError: Collapsing section named 'sync:gentoo'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/pkgcheck", line 4, in <module>
    scripts.run(basename(__file__))
  File "/usr/lib/python3.10/site-packages/pkgcheck/scripts/__init__.py", line 38, in run
    sys.exit(tool())
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/tool.py", line 79, in __call__
    ret = self.main()
  File "/usr/lib/python3.10/site-packages/pkgcheck/cli.py", line 21, in main
    return super().main()
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/tool.py", line 185, in main
    self.handle_exec_exception(e)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/tool.py", line 169, in main
    self.options, func = self.parse_args(args=self.args, namespace=self.options)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/tool.py", line 124, in parse_args
    self.handle_exec_exception(e)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/tool.py", line 100, in parse_args
    options = self.parser.parse_args(args=args, namespace=namespace)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 1176, in parse_args
    args, unknown_args = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 1163, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 2050, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/usr/lib/python3.10/argparse.py", line 2027, in consume_positionals
    take_action(action, args)
  File "/usr/lib/python3.10/argparse.py", line 1936, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 517, in __call__
    namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 1160, in parse_known_args
    namespace, args = functor(parser, namespace, args)
  File "/usr/lib/python3.10/site-packages/pkgcheck/scripts/pkgcheck_scan.py", line 332, in _setup_scan
    namespace.target_repo = _determine_target_repo(namespace)
  File "/usr/lib/python3.10/site-packages/pkgcheck/scripts/pkgcheck_scan.py", line 229, in _determine_target_repo
    for repo in namespace.domain.ebuild_repos_raw:
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 563, in __getattribute__
    val(self, name)
  File "/usr/lib/python3.10/site-packages/snakeoil/cli/arghparse.py", line 354, in __call__
    self.invokable(namespace, attr)
  File "/usr/lib/python3.10/site-packages/pkgcore/util/commandline.py", line 210, in store_default
    obj = config.get_default(config_type)
  File "/usr/lib/python3.10/site-packages/pkgcore/config/central.py", line 575, in get_default
    raise errors.ConfigurationError(
pkgcore.config.errors.ConfigurationError: Collapsing defaults for 'domain'
Comment 1 Julien 2022-09-21 01:58:47 UTC
$ emerge --info pkgdev
Portage 3.0.36 (python 3.10.6-final-0, default/linux/amd64/17.1/desktop, gcc-11.3.0, glibc-2.35-r8, 5.15.59-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.15.59-gentoo-x86_64-AMD_Ryzen_5_5500U_with_Radeon_Graphics-with-glibc2.35
KiB Mem:    32200556 total,  19680676 free
KiB Swap:   16777212 total,  16775420 free
Timestamp of repository gentoo: Sun, 18 Sep 2022 17:00:01 +0000
Head commit of repository gentoo: 140c67738dc9503f22a88e3819a6fb47ac903588
Head commit of repository MrRoy-Overlay: 3351ed6c646243fcd6c981d44780b2f50d458e15

Head commit of repository guru: 0c3602fedc67cf2e92ea5ea7347bb50e5f542d53

Timestamp of repository src_prepare-overlay: Sat, 17 Sep 2022 23:16:40 +0000
Head commit of repository src_prepare-overlay: 92e167e6d67f2adec5bb28e47ecef4d1e08d1234

sh dash 0.5.11.5
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.6_p4::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

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

MrRoy-Overlay
    location: /var/db/repos/MrRoy-Overlay
    sync-type: git
    sync-uri: https://git.jroy.ca/MrRoy-Overlay
    masters: gentoo

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo

src_prepare-overlay
    location: /var/db/repos/src_prepare-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/src_prepare-overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=znver2 -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask n"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-march=znver2 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver2 -O2 -pipe"
GENTOO_MIRRORS="rsync://mirror.csclub.uwaterloo.ca/gentoo-distfiles"
INSTALL_MASK="/lib/systemd/ /usr/lib/systemd /etc/systemd"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12"
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"
SHELL="/bin/bash"
USE="a52 aac acl acpi alsa amd64 bash-completion bluetooth branding bzip2 cairo cdda cdr cli crypt dbus dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gpm gtk gui iconv icu jpeg lcms libglvnd libnotify libtirpc lto mad man mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf pgo pipewire png policykit ppds qt5 readline screencast sdl seccomp spell split-usr ssl startup-notification svg tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vorbis vulkan wayland wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="(64) 64" ADA_TARGET="gnat_2020" 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_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" 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="synaptics libinput" KERNEL="linux" L10N="en" 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="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu" 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, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

dev-util/pkgdev-0.2.1-r2::gentoo was built with the following:
USE="-doc -test" ABI_X86="(64)" PYTHON_TARGETS="python3_10 -python3_8 -python3_9"
FEATURES="ebuild-locks xattr usersync merge-sync network-sandbox binpkg-dostrip binpkg-logs protect-owned news userpriv buildpkg-live sandbox unmerge-logs unknown-features-warn distlocks sfperms pid-sandbox userfetch ipc-sandbox qa-unresolved-soname-deps multilib-strict binpkg-docompress config-protect-if-modified preserve-libs parallel-fetch unmerge-orphans assume-digests strict usersandbox fixlafiles"
Comment 2 Julien 2022-09-21 02:07:21 UTC
I'm not sure when this began as I haven't used pkgdev/pkgcheck in a few months, but the last time I used it, it worked fine.
I tried version 0.2.1-r{1,2,3} and the issue happens on all versions.

The error happens with both pkgcheck and pkgdev, with any/all subcommands
pkgdev {commit,manifest,mask,push,showkw}
pkgcheck {cache,ci,scan,show}
Comment 3 Julien 2022-09-21 02:12:15 UTC
I upgraded sys-apps/pkgcore to keyworded 0.12.14 (from 0.12.13-r1) and the issue persists.

$ emerge --info sys-apps/pkgcore

[snip]

=================================================================
                        Package Settings
=================================================================

sys-apps/pkgcore-0.12.14::gentoo was built with the following:
USE="-test" ABI_X86="(64)" PYTHON_TARGETS="python3_10 -python3_11 -python3_8 -python3_9"
FEATURES="qa-unresolved-soname-deps merge-sync buildpkg-live usersandbox binpkg-docompress protect-owned parallel-fetch binpkg-logs fixlafiles unmerge-orphans ebuild-locks pid-sandbox distlocks news sfperms ipc-sandbox binpkg-dostrip config-protect-if-modified unmerge-logs unknown-features-warn strict assume-digests sandbox userpriv xattr multilib-strict network-sandbox preserve-libs userfetch usersync"
Comment 4 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 15:47:48 UTC
Hi.

I suspect this issue is as a result of configuration in /etc/portage/ that now breaks pkgcore, which results in broken pkgcheck & pkgdev.

I suspect something with value of PORTAGE_RSYNC_INITIAL_TIMEOUT - can you please write what is the value of this var?

Also would be nice to get attached your /etc/portage/make.conf or even better tarball of all /etc/portage/ (if possible)

I want to try to reproduce on my machine your setup, so I can debug and hopefully find a solution.
Comment 5 Julien 2022-09-30 16:02:43 UTC
Created attachment 814798 [details]
/etc/portage content

Hello,

Well spotted, I do indeed have a custom value set in my make.conf:
PORTAGE_RSYNC_INITIAL_TIMEOUT=60

This is because I have an rsync server on my network for the ::gentoo repository. I have multiple Gentoo boxes on my network, so as not to flood the Gentoo servers with dozens of rsyncs every week, I have this server, however sometimes it responds slowly, so I set PORTAGE_RSYNC_INITIAL_TIMEOUT to 60 seconds to allow the syncs to work without timeouts.

I have attached my /etc/portage to this comment, so you can test yourself, though it might not be feasible without your own rsync server.
Comment 6 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 16:27:16 UTC
OK, when I added a rsync target (just configuration at repos.conf) and added PORTAGE_RSYNC_INITIAL_TIMEOUT=60 to make.conf it breaks the same

Will look at it now at fix it :)

Thanks for report and reproducer
Comment 7 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 16:44:41 UTC
I think I managed to fix it.

Please try to include this patch and reemerge pkgcore:

1. mkdir -p /etc/portage/patches/sys-apps/pkgcore
2. curl 'https://github.com/pkgcore/pkgcore/pull/368.patch' -o /etc/portage/patches/sys-apps/pkgcore/fix-368.patch
3. emerge --usepkg n --buildpkg n --oneshot --ask sys-apps/pkgcore

And now please test it :)
Comment 8 Julien 2022-09-30 16:53:32 UTC
Indeed, it fixed it!
Thanks
Comment 9 Larry the Git Cow gentoo-dev 2022-10-04 10:30:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6b021d8c364861fd8e65d65495228ce5317afdf

commit e6b021d8c364861fd8e65d65495228ce5317afdf
Author:     Arthur Zamarin <arthurzam@gentoo.org>
AuthorDate: 2022-10-04 10:28:32 +0000
Commit:     Arthur Zamarin <arthurzam@gentoo.org>
CommitDate: 2022-10-04 10:29:57 +0000

    sys-apps/pkgcore: add 0.12.16
    
    Closes: https://bugs.gentoo.org/872116
    Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>

 sys-apps/pkgcore/Manifest               |  1 +
 sys-apps/pkgcore/pkgcore-0.12.16.ebuild | 56 +++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)