Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 850901 - FileNotFoundEror when installing ebuilds in sys-apps/portage
Summary: FileNotFoundEror when installing ebuilds in sys-apps/portage
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-09 22:24 UTC by qe09ol+2ofx5js1o09zw
Modified: 2022-06-14 05:40 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qe09ol+2ofx5js1o09zw 2022-06-09 22:24:32 UTC
This has been happening for a long time. In the install phase and even when you do an ebuild glibc or somethign else .ebuild install you get FileNotFound error. If you run sync on the filesystem in the background (like from a shell while true ; do sleep 0.3 ; sync ; done) the ebuild .... install almost always works.

Has been happening with pythons 3.[7...11]

Traceback (most recent call last):
  File "/usr/lib/portage/python3.11/doins.py", line 195, in run
    copyfile(source, dest)
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portage/util/file_copy/__init__.py", line 31, in _optimized_copyfile
    _file_copy(src_file.fileno(), dst_file.fileno())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory


Reproducible: Always
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 22:33:59 UTC
I've never seen this. How do you produce this error?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 06:38:42 UTC
Please attach an example full build log with the error, and your emerge --info.

Are you using NFS or any other "unusual" file system?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 06:41:31 UTC
(FWIW, it's considered somewhat impolite to use a disposable email for something like this, as we can't really ask follow up questions.)
Comment 4 qe5101+answ6n5r48bus 2022-06-14 05:40:30 UTC
Sorry for the disposable email, but it is for my own protection.
There are no special filesystems. Tmpfs is used a lot for the build and ext4 without journal + extents (default). The filesystems are blown away quite often.

The only thing that I can think of is that this is being built inside a container - using systemd-nspawn.

You are right to think that it is strange because the file does exist when you check from the shell but it is only the python that cannot find it.

The contrainer is spawned thus (ccache wasn't used when this happened)  buildDir is usually tmpfs (22G):

    command+="ip addr add dev host0 ${iphost} ; ip link set host0 up ; ip route add default via ${ipgw} ; cd ; "
    command+="ip -6 addr add dev host0 ${ip6host} ; ip -6 route add default via ${ip6gw} ; cd ; "
    command+="mkdir /run/lock ; "
    command+="mv /etc/random-seed /run/ ; "
    command+="dbus-uuidgen --ensure=/run/machine-id ;"
    command+="chmod 1777 /tmp ; "
    command+="exec ${*}"
    systemd-nspawn \
        --register=no \
        --tmpfs=/home \
        --tmpfs=/var/cache \
        --tmpfs=/var/log \
        --tmpfs=/var/tmp \
        --bind-ro=${kernel_git}:/tmp/linux-stable.git \
        --bind=${portage_dir}:/tmp/portage/ \
        --bind=${distFiles}:/tmp/distfiles \
        --bind=${ccDir}:/tmp/ccache \
        --bind=${buildDir}/${contname}:/tmp/build \
        --link-journal=no \
        --private-network \
        --network-veth \
        --setenv=SHELL=/bin/bash \
        --machine "build-${contname}" --directory "${contpath}" \
        /bin/bash --login -c "${command}"