Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 837533 - dispatch-conf crashes with "Not a directory"
Summary: dispatch-conf crashes with "Not a directory"
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 837899
Blocks:
  Show dependency tree
 
Reported: 2022-04-09 19:54 UTC by mtrnord
Modified: 2022-07-10 16:32 UTC (History)
0 users

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


Attachments
info output for portage package and error log (log-and-info-output.zip,4.82 KB, application/x-zip-compressed)
2022-04-09 19:54 UTC, mtrnord
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mtrnord 2022-04-09 19:54:07 UTC
Created attachment 769700 [details]
info output for portage package and error log

Hi :)

Running dispatch-conf on my server crashes due to "NotADirectoryError: [Errno 20] Not a directory: b'/etc/config-archive/etc/portage/package.use/r' -> b'/etc/config-archive/etc/portage/package.use/r.dist.new'" for me. The full log is attached in the zip, as well as the emerge --info output for the portage package.

Filesystem if it matters is zfs.

Didn't find a workaround, but I did at some point change "package.use" from file based to directory based. But I am not sure how rcs works to correctly make that change apply, but I would have assumed it figures that out or at least doesn't crash midway.
Also, etc-update still works just fine.
Comment 1 mtrnord 2022-04-09 19:57:45 UTC
Also possibly related is https://bugs.gentoo.org/256376 as it seems to be close to what I did
Comment 2 Mike Gilbert gentoo-dev 2022-04-09 20:29:55 UTC
Please provide emerge --info in a comment so it may be more easily reviewed.
Comment 3 mtrnord 2022-04-09 21:01:55 UTC
"emerge --info":

➜  ~ emerge --info
Portage 3.0.30 (python 3.9.9-final-0, default/linux/amd64/17.1/systemd, gcc-11.2.1, glibc-2.34-r10, 5.15.26-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.15.26-gentoo-x86_64-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-glibc2.34
KiB Mem:   131911868 total,  10869584 free
KiB Swap:  100663288 total,  83699192 free
Timestamp of repository gentoo: Fri, 08 Apr 2022 09:19:32 +0000
Head commit of repository gentoo: 8c32148af3b543483c9271dd1037eadc7a11dcd7

sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           3.8.13::gentoo, 3.9.9-r1::gentoo, 3.10.2_p1::gentoo
dev-lang/rust:             1.58.1::gentoo
dev-util/cmake:            3.22.2::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          249.11::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           13.0.1::gentoo
sys-devel/gcc:             11.2.1_p20220115::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.1::gentoo
sys-devel/llvm:            13.0.1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r10::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    priority: 100000

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/php/fpm-php8.0/ext-active/ /etc/php/phpdbg-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection"
DISTDIR="/var/cache/distfiles"
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=native -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=native -O2 -pipe"
GENTOO_MIRRORS="https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ https://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/ https://ftp.fau.de/gentoo https://ftp.gwdg.de/pub/linux/gentoo/ https://ftp.halifax.rwth-aachen.de/gentoo/ https://ftp.leg.uct.ac.za/pub/linux/gentoo/ https://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/ https://ftp.snt.utwente.nl/pub/os/linux/gentoo https://ftp.tu-ilmenau.de/mirror/gentoo/ https://ftp.uni-hannover.de/gentoo/ https://gentoo-mirror.alexxy.name/ https://gentoo.mirror.garr.it/ https://gentoo.osuosl.org/ https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ https://mirror.bytemark.co.uk/gentoo/ https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ https://mirror.dkm.cz/gentoo/ https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ https://mirror.init7.net/gentoo/ https://mirror.isoc.org.il/pub/gentoo/ https://mirror.lagoon.nc/gentoo/ https://mirror.leaseweb.com/gentoo/ https://mirror.netcologne.de/gentoo/ https://mirror.rackspace.com/gentoo/ https://mirror.ufro.cl/gentoo/ https://mirror.wheel.sk/gentoo https://mirror.yandex.ru/gentoo-distfiles/ https://mirrors.163.com/gentoo/ https://mirrors.aliyun.com/gentoo/ https://mirrors.dotsrc.org/gentoo/ https://mirrors.ircam.fr/pub/gentoo-distfiles/ https://mirrors.rit.edu/gentoo/ https://mirrors.soeasyto.com/distfiles.gentoo.org/ https://packages.hs-regensburg.de/gentoo-distfiles/ https://www.mirrorservice.org/sites/distfiles.gentoo.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
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/zsh"
USE="acl amd64 bzip2 cli crypt dri fortran gdbm headless-awt iconv ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl systemd threads udev unicode xattr zlib zsh-completion" ABI_X86="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" GRUB_PLATFORMS="efi-64" 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="php7-4 php8-0" POSTGRES_TARGETS="postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, 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
Comment 4 Mike Gilbert gentoo-dev 2022-04-10 13:46:35 UTC
In the future, please attach logs separately, without compression if they are under 1 MB.

From error-log.txt:

dispatch-conf: Error copying /etc/portage/package.use/r to /etc/config-archive/etc/portage/package.use/r: [Errno 20] Not a directory: b'/etc/config-archive/etc/portage/package.use/r'
ci: /etc/config-archive/etc/portage/package.use/RCS/r,v: Not a directory
co: /etc/config-archive/etc/portage/package.use/RCS/r,v: Not a directory
dispatch-conf: Error copying /etc/portage/package.use/._cfg0000_r to /etc/config-archive/etc/portage/package.use/r: [Errno 20] Not a directory: b'/etc/config-archive/etc/portage/package.use/r'
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/dispatch-conf", line 531, in <module>
    d.grind(portage.util.shlex_split(
  File "/usr/lib/python-exec/python3.9/dispatch-conf", line 273, in grind
    confs = [x for x in confs if f(x)]
  File "/usr/lib/python-exec/python3.9/dispatch-conf", line 273, in <listcomp>
    confs = [x for x in confs if f(x)]
  File "/usr/lib/python-exec/python3.9/dispatch-conf", line 190, in f
    mrgfail = portage.dispatch_conf.rcs_archive(archive, conf['current'], conf['new'], mrgconf)
  File "/usr/lib/python3.9/site-packages/portage/dispatch_conf.py", line 257, in rcs_archive
    os.rename(archive, archive + ".dist.new")
  File "/usr/lib/python3.9/site-packages/portage/__init__.py", line 282, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
NotADirectoryError: [Errno 20] Not a directory: b'/etc/config-archive/etc/portage/package.use/r' -> b'/etc/config-archive/etc/portage/package.use/r.dist.new'
Comment 5 Mike Gilbert gentoo-dev 2022-04-10 13:48:05 UTC
Please show the output of ls -l /etc/config-archive/etc/portage/package.use*
Comment 6 mtrnord 2022-04-10 13:51:32 UTC
Sorry will keep in mind how to attach the log for next time :)

Output is:


➜  ~ ls -l /etc/config-archive/etc/portage/package.use*
-rw-r--r-- 1 root root   1 Aug 22  2021 /etc/config-archive/etc/portage/package.use
-rw-r--r-- 1 root root 466 Aug 22  2021 /etc/config-archive/etc/portage/package.use.dist
Comment 7 Mike Gilbert gentoo-dev 2022-04-10 14:56:30 UTC
If you remove /etc/config-archive/etc/portage/package.use, I think dispatch-conf will start working again.
Comment 8 Mike Gilbert gentoo-dev 2022-04-11 12:49:02 UTC
You probably ran dispatch-conf with use-rcs=no while package.use was a regular file (not a directory). This would have copied it into /etc/config-archive without a ",v" suffix.

After setting use-rcs=yes, you should remove or rename /etc/config-archive to ensure that rcs has a clean starting point for tracking changes.

I'll add a note about this to dispatch-conf.conf.
Comment 9 Larry the Git Cow gentoo-dev 2022-04-11 20:17:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=dbb4d075ee4991e2b5efdc55dc2d1da2572d8afd

commit dbb4d075ee4991e2b5efdc55dc2d1da2572d8afd
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-04-11 12:50:12 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-04-11 12:50:12 +0000

    dispatch-conf: add a warning about changing the use-rcs setting
    
    If there are existing files in the archive directory, this may cause
    conflicts with the files/directories managed using rcs.
    
    Bug: https://bugs.gentoo.org/837533
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 cnf/dispatch-conf.conf | 3 +++
 1 file changed, 3 insertions(+)
Comment 10 mtrnord 2022-04-12 17:11:36 UTC
(In reply to Mike Gilbert from comment #8)
> You probably ran dispatch-conf with use-rcs=no while package.use was a
> regular file (not a directory). This would have copied it into
> /etc/config-archive without a ",v" suffix.
> 
> After setting use-rcs=yes, you should remove or rename /etc/config-archive
> to ensure that rcs has a clean starting point for tracking changes.
> 
> I'll add a note about this to dispatch-conf.conf.

As far as I am aware I never manually changed that but maybe I at some point updated the config which caused that :) I will rename the folder to make sure it is clean after applying the rest of the changes using the earlier mentioned workaround. Thanks for the help.