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

Bug 732542

Summary: dev-db/influxdb-1.8.0: fails to install on prefix, PermissionError: [Errno 13] Permission denied: 'circle.yml'
Product: Gentoo/Alt Reporter: Guilherme Amadio <amadio>
Component: Prefix SupportAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Guilherme Amadio gentoo-dev 2020-07-14 10:32:45 UTC
Created attachment 649154 [details]
build.log

The build process creates files that cannot be removed later on prefix.
Error message for installation is shown below. Full build.log attached.

>>> Installing (1 of 1) dev-db/influxdb-1.8.0::gentoo
Traceback (most recent call last):
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/package/ebuild/prepare_build_dirs.py", line 44, in prepare_build_dirs
    shutil.rmtree(clean_dir)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/__init__.py", line 246, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 715, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 652, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 652, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 652, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  [Previous line repeated 3 more times]
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 672, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/shutil.py", line 670, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'circle.yml'

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

Traceback (most recent call last):
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/dbapi/_MergeProcess.py", line 233, in _spawn
    rval = mylink.merge(self.pkgloc, self.infloc,
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/dbapi/vartree.py", line 1781, in wrapper
    return f(self, *args, **kwargs)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/dbapi/vartree.py", line 5376, in merge
    retval = self.treewalk(mergeroot, myroot, inforoot, myebuild,
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/dbapi/vartree.py", line 4256, in treewalk
    prepare_build_dirs(settings=self.settings, cleanup=cleanup)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/package/ebuild/prepare_build_dirs.py", line 56, in prepare_build_dirs
    _raise_exc(oe)
  File "/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/usr/lib/python3.8/site-packages/portage/util/install_mask.py", line 157, in _raise_exc
    raise wrapper
portage.exception.PermissionDenied: [Errno 13] Permission denied: 'circle.yml'

>>> Failed to install dev-db/influxdb-1.8.0, Log file:


emerge --info:
gentoo ~ $ emerge --info
Portage 2.3.103 (python 3.8.3-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-2.6.32+, gcc-8.4.0, glibc-2.25-r11, 2.6.32-754.27.1.el6.x86_64 x86_64)
=================================================================
System uname: Linux-2.6.32-754.27.1.el6.x86_64-x86_64-Intel_Core_Processor_-Haswell,_no_TSX,_IBRS-with-glibc2.2.5
KiB Mem:     7492608 total,   2155912 free
KiB Swap:          0 total,         0 free
Head commit of repository amadio: 9c96c07fb4c6bf961cfa033ddb9548b006705653

Head commit of repository gentoo: d169896e7659eb598f755faf5c7959fd52d199a5

sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p4) 2.34.0
ccache version 3.7.10 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.5.7::gentoo, 3.6.11-r1::gentoo, 3.7.8-r1::gentoo, 3.8.3-r1::gentoo, 3.9.0_beta4::gentoo
dev-util/ccache:          3.7.10::gentoo
dev-util/cmake:           3.17.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.2::gentoo
sys-devel/binutils:       2.30-r3::gentoo, 2.31.1-r4::gentoo, 2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r1::gentoo
sys-devel/gcc:            6.5.0-r2::gentoo, 7.5.0-r1::gentoo, 8.3.0-r3::gentoo, 8.4.0-r1::gentoo, 9.3.0-r1::gentoo, 10.1.0-r2::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r11::gentoo
Repositories:

amadio
    location: /cvmfs/sft.cern.ch/lcg/contrib/gentoo/portage/amadio
    sync-type: git
    sync-uri: https://github.com/amadio/gentoo-overlay.git
    masters: gentoo
    priority: 0
    sync-git-pull-extra-opts: --quiet

gentoo
    location: /cvmfs/sft.cern.ch/lcg/contrib/gentoo/portage/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: 1
    sync-git-pull-extra-opts: --quiet

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/etc /etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/etc/env.d /cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/etc/gentoo-release /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -O2 -pipe"
DISTDIR="/tmp/portage/distfiles"
ENV_UNSET="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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix ipc-sandbox merge-sync multilib-strict network-sandbox parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 -l4"
PKGDIR="/tmp/portage/packages"
PORTAGE_CONFIGROOT="/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/"
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="/tmp"
USE="X acl amd64 berkdb bzip2 cairo cli crypt cups dri fortran gdbm gif iconv ipv6 jpeg lapack libtirpc ncurses nptl old-kernel openmp pcre png prefix python readline seccomp split-usr sqlite ssl svg tcpd tiff truetype unicode xml zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 ssse3 sse4_1 sse4_2" 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_6 python3_7 python3_8" RUBY_TARGETS="ruby27 ruby26" USERLAND="GNU" VIDEO_CARDS="i915 i965 intel iris nouveau 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Guilherme Amadio gentoo-dev 2020-07-14 10:34:42 UTC
Some extra information:

gentoo ~ $ find /tmp/portage/dev-db/influxdb-1.8.0 -name circle.yml | xargs ls -l
-r--r--r-- 1 jenkins jenkins 4055 Jul 14 10:26 /tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/gopherjs/gopherjs@v0.0.0-20181017120253-0766667cb4d1/circle.yml
-r--r--r-- 1 jenkins jenkins  490 Jul 14 10:26 /tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/influxdata/usage-client@v0.0.0-20160829180054-6d3895376368/circle.yml
-r--r--r-- 1 jenkins jenkins  113 Jul 14 10:26 /tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/klauspost/pgzip@v1.0.2-0.20170402124221-0bf5dcad4ada/circle.yml
-r--r--r-- 1 jenkins jenkins  507 Jul 14 10:26 /tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/paulbellamy/ratecounter@v0.2.0/circle.yml
gentoo ~ $ find /tmp/portage/dev-db/influxdb-1.8.0 -name circle.yml | xargs rm   
rm: cannot remove '/tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/influxdata/usage-client@v0.0.0-20160829180054-6d3895376368/circle.yml': Permission denied
rm: cannot remove '/tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/paulbellamy/ratecounter@v0.2.0/circle.yml': Permission denied
rm: cannot remove '/tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/gopherjs/gopherjs@v0.0.0-20181017120253-0766667cb4d1/circle.yml': Permission denied
rm: cannot remove '/tmp/portage/dev-db/influxdb-1.8.0/homedir/go/pkg/mod/github.com/klauspost/pgzip@v1.0.2-0.20170402124221-0bf5dcad4ada/circle.yml': Permission denied
Comment 2 William Hubbs gentoo-dev 2020-07-15 23:07:01 UTC
The issue will be fixed when I can add -modcacherw to the GOFLAGS
environment variable in go-module.eclass. [1]

I'll be able to do this when I can remove go 1.12 and 1.13 from the
tree; this will happen when 1.15 comes out next nonth.

In the meantime, what do you suggest?

I'm thinking about putting some code in pkg_preinst or pkg_postinst in
the eclass, but to do this, I need to know the best way to detect
prefix. Is it the prefix use flag?
Comment 3 William Hubbs gentoo-dev 2020-07-15 23:07:31 UTC
The reference from the previous comment:

[1] https://golang.org/doc/go1.14
Comment 4 Guilherme Amadio gentoo-dev 2020-07-16 06:55:56 UTC
Using the prefix USE flag is ok, you can also check for non-empty $EPREFIX if you prefer.

Maybe you can enable the flag when you detect that a version of go that supports it is being used? This probably doesn't have to wait for 1.15. Prefix is unstable by definition, so I'm on 1.14 there.
Comment 5 William Hubbs gentoo-dev 2023-08-25 15:52:51 UTC
This was fixed some time ago since go is up to version 1.21 and
-modcacherw is a default build option.