Subject: bug#52103: guix pull: guix-manual.drv' failed with exit code 1, In procedure copy-file: Permission denied

From: Christopher Baines <[email-masked]>
Date: Sat, 11 Dec 2021 09:53:59 +0000

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Christopher Baines <[email-masked]> skribis:
>
>> I'm having trouble pulling on a aarch64-linux machine, both from master
>> and core-updates-frozen, and they fail with similar output.
>
> FWIW I’ve successfully upgraded on aarch64-linux to current ‘master’:
>
> ludo@overdrive1 ~$ guix describe
> Generation 12   Dec 10 2021 14:24:21    (current)
>   guix 18c406d
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: 18c406df973d24fa8adb9cdaf58d73769da44937
> ludo@overdrive1 ~$ uname -om
> aarch64 GNU/Linux
>
>
> [...]
>
>> \builder for `/gnu/store/g55hf0qbs3yhwrvi3lq5v4xaj1bw9mrd-guix-manual.drv' failed with exit code 1
>> build of /gnu/store/g55hf0qbs3yhwrvi3lq5v4xaj1bw9mrd-guix-manual.drv failed
>> View build log at '/var/log/guix/drvs/g5/5hf0qbs3yhwrvi3lq5v4xaj1bw9mrd-guix-manual.drv.bz2'.
>> cannot build derivation `/gnu/store/pdbv64gcy97cm3xw9iwnxzd6npazvp5s-guix-4fd6aabea.drv': 1 dependencies couldn't be built
>> cannot build derivation `/gnu/store/pa2apwy1nypkxggh3p75yi9rmghn0xjy-profile.drv': 1 dependencies couldn't be built
>> guix time-machine: error: build of `/gnu/store/pa2apwy1nypkxggh3p75yi9rmghn0xjy-profile.drv' failed
>>
>> cbaines@hatysa ~$ bzcat /var/log/guix/drvs/g5/5hf0qbs3yhwrvi3lq5v4xaj1bw9mrd-guix-manual.drv.bz2
>> Backtrace: 
>>            4 (primitive-load "/gnu/store/h9n0ssml2v8j9bzxxx1zjj0swn3?")
>> In ice-9/eval.scm:
>>     619:8  3 (_ #f)
>> In ice-9/ftw.scm:
>>    505:39  2 (loop _ _ #(66306 8660889 16749 2 0 0 0 4096 # 1 # # ?) ?)
>> In guix/build/utils.scm:
>>    345:27  1 (_ "/gnu/store/4wfkj6z151b97f54415g39apc58chsx7-guix-t?" ?)
>> In unknown file:
>>            0 (copy-file "/gnu/store/4wfkj6z151b97f54415g39apc58chsx?" ?)
>>
>> ERROR: In procedure copy-file:
>> In procedure copy-file: Permission denied
>
> Are you still experiencing this?

Yep.

> If yes, could you share the .drv file name and maybe strace -f the child
> guix-daemon process to get the file names that the backtrace is
> hiding?

I've had a go at debugging this further, I'm not confident I've found
the relevant part of the strace output, but I think it could be this bit:

14403 newfstatat(AT_FDCWD, "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-translated-texinfo/guix.de.texi", {st_mode=S_IFREG|0444, st_size=925279, ...}, AT_SYMLINK_NOFOLLOW) = 0
14403 openat(AT_FDCWD, "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-translated-texinfo/guix.de.texi", O_RDONLY) = 15
14403 fstat(15, {st_mode=S_IFREG|0444, st_size=925279, ...}) = 0
14403 openat(AT_FDCWD, "./guix.de.texi", O_WRONLY|O_CREAT|O_TRUNC, 0444) = -1 EACCES (Permission denied)

There's more information below. I wonder if this could somehow be
connected to guix.de.texi being both in the -doc store item, and
-guix-translated-texinfo. Reading the builder, it looks like it copies
it first from -doc, then again from -guix-translated-texinfo, and that's
the point at which it fails?

cbaines@hatysa ~$ guix build /gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv --keep-failed
The following derivation will be built:
   /gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv
building /gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv...
Backtrace:
           4 (primitive-load "/gnu/store/l9dnjs4h1vxdnbxc3ips7p6s6kf?")
In ice-9/eval.scm:
    619:8  3 (_ #f)
In ice-9/ftw.scm:
   505:39  2 (loop _ _ #(66306 15087543 16749 2 0 0 0 4096 # 1 # # ?) ?)
In guix/build/utils.scm:
   345:27  1 (_ "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-t?" ?)
In unknown file:
           0 (copy-file "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf?" ?)

ERROR: In procedure copy-file:
In procedure copy-file: Permission denied
note: keeping build directory `/tmp/guix-build-guix-manual.drv-0'
builder for `/gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv' failed with exit code 1
build of /gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv failed
View build log at '/var/log/guix/drvs/qp/ms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv.bz2'.
guix build: error: build of `/gnu/store/qpms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv' failed

cbaines@hatysa ~$ bzcat /var/log/guix/drvs/qp/ms3smm2fmdcmv0q727yfqbcclw8laq-guix-manual.drv.bz2
Backtrace:
           4 (primitive-load "/gnu/store/l9dnjs4h1vxdnbxc3ips7p6s6kf?")
In ice-9/eval.scm:
    619:8  3 (_ #f)
In ice-9/ftw.scm:
   505:39  2 (loop _ _ #(66306 15087543 16749 2 0 0 0 4096 # 1 # # ?) ?)
In guix/build/utils.scm:
   345:27  1 (_ "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-t?" ?)
In unknown file:
           0 (copy-file "/gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf?" ?)

ERROR: In procedure copy-file:
In procedure copy-file: Permission denied

cbaines@hatysa ~$ ls -l /tmp/guix-build-guix-manual.drv-0
total 5068
-r--r--r-- 1 cbaines users   54631 Dec 11 09:59 build.scm
-r--r--r-- 1 cbaines users   23526 Dec 11 09:59 contributing.de.texi
-r--r--r-- 1 cbaines users   45405 Dec 11 09:59 contributing.fr.texi
-r--r--r-- 1 cbaines users   81777 Dec 11 09:59 contributing.texi
-r--r--r-- 1 cbaines users     481 Dec 11 09:59 environment-gdb.scm
-r--r--r-- 1 cbaines users   23433 Dec 11 09:59 fdl-1.3.texi
-r--r--r-- 1 cbaines users  107412 Dec 11 09:59 guix-cookbook.texi
-r--r--r-- 1 cbaines users  925279 Dec 11 09:59 guix.de.texi
-r--r--r-- 1 cbaines users 1019672 Dec 11 09:59 guix.fr.texi
-r--r--r-- 1 cbaines users 1398923 Dec 11 09:59 guix.pt_BR.texi
-r--r--r-- 1 cbaines users 1388712 Dec 11 09:59 guix.texi
-r--r--r-- 1 cbaines users     698 Dec 11 09:59 he-config-bare-bones.scm
-r--r--r-- 1 cbaines users   22650 Dec 11 09:59 htmlxref.cnf
drwxr-xr-x 2 cbaines users    4096 Dec 11 09:59 images/
-r--r--r-- 1 cbaines users    8750 Dec 11 09:59 local.mk
-r--r--r-- 1 cbaines users    2241 Dec 11 09:59 os-config-asus-c201.texi
-r--r--r-- 1 cbaines users    1920 Dec 11 09:59 os-config-bare-bones.texi
-r--r--r-- 1 cbaines users    2083 Dec 11 09:59 os-config-bare-hurd.texi
-r--r--r-- 1 cbaines users    2180 Dec 11 09:59 os-config-beaglebone-black.texi
-r--r--r-- 1 cbaines users    3063 Dec 11 09:59 os-config-desktop.texi
-r--r--r-- 1 cbaines users    1574 Dec 11 09:59 os-config-docker-image.texi
-r--r--r-- 1 cbaines users    2157 Dec 11 09:59 os-config-lightweight-desktop.texi
-r--r--r-- 1 cbaines users    5173 Dec 11 09:59 os-config-vm-image.texi
-r--r--r-- 1 cbaines users    2299 Dec 11 09:59 os-config-yggdrasil.texi
-r--r--r-- 1 cbaines users     840 Dec 11 09:59 package-hello.json
-r--r--r-- 1 cbaines users     615 Dec 11 09:59 package-hello.scm
-rw-r--r-- 1 cbaines users     103 Dec 11 09:59 version.texi

cbaines@hatysa ~$ ls -l /gnu/store/xs88gf6b06fdfdpbi6rasi789wfgiqf0-doc
total 3656
-r--r--r-- 29 root root   54631 Jan  1  1970 build.scm
-r--r--r-- 17 root root   23526 Jan  1  1970 contributing.de.texi
-r--r--r-- 17 root root   45405 Jan  1  1970 contributing.fr.texi
-r--r--r--  5 root root   81777 Jan  1  1970 contributing.texi
-r--r--r--  1 root root     481 Jan  1  1970 environment-gdb.scm
-r--r--r-- 45 root root   23433 Jan  1  1970 fdl-1.3.texi
-r--r--r-- 39 root root  107412 Jan  1  1970 guix-cookbook.texi
-r--r--r-- 17 root root  925279 Jan  1  1970 guix.de.texi
-r--r--r-- 17 root root 1019672 Jan  1  1970 guix.fr.texi
-r--r--r--  5 root root 1388712 Jan  1  1970 guix.texi
-r--r--r--  1 root root     698 Jan  1  1970 he-config-bare-bones.scm
-r--r--r-- 44 root root   22650 Jan  1  1970 htmlxref.cnf
dr-xr-xr-x  2 root root    4096 Jan  1  1970 images/
-r--r--r-- 25 root root    8750 Jan  1  1970 local.mk
-r--r--r--  1 root root     840 Jan  1  1970 package-hello.json
-r--r--r--  1 root root     615 Jan  1  1970 package-hello.scm

cbaines@hatysa ~$ ls -l /gnu/store/vcgx18jbb4dyk8kxx2gn8046jsavlgf8-guix-translated-texinfo/
total 14736
-r--r--r-- 17 root root   23526 Jan  1  1970 contributing.de.texi
-r--r--r--  2 root root   89269 Jan  1  1970 contributing.es.texi
-r--r--r--  2 root root   81975 Jan  1  1970 contributing.fa.texi
-r--r--r-- 17 root root   45405 Jan  1  1970 contributing.fr.texi
-r--r--r--  2 root root   81918 Jan  1  1970 contributing.it.texi
-r--r--r--  2 root root   81933 Jan  1  1970 contributing.ko.texi
-r--r--r--  2 root root   84356 Jan  1  1970 contributing.pt_BR.texi
-r--r--r--  2 root root  122037 Jan  1  1970 contributing.ru.texi
-r--r--r--  2 root root   82168 Jan  1  1970 contributing.sk.texi
-r--r--r--  2 root root   78200 Jan  1  1970 contributing.zh_CN.texi
-r--r--r--  2 root root  123368 Jan  1  1970 guix-cookbook.de.texi
-r--r--r--  2 root root  108009 Jan  1  1970 guix-cookbook.es.texi
-r--r--r--  6 root root  107958 Jan  1  1970 guix-cookbook.fa.texi
-r--r--r--  6 root root  118742 Jan  1  1970 guix-cookbook.fr.texi
-r--r--r--  6 root root  106693 Jan  1  1970 guix-cookbook.ko.texi
-r--r--r--  6 root root  108002 Jan  1  1970 guix-cookbook.ru.texi
-r--r--r--  6 root root  108510 Jan  1  1970 guix-cookbook.sk.texi
-r--r--r-- 17 root root  925279 Jan  1  1970 guix.de.texi
-r--r--r--  2 root root 1555832 Jan  1  1970 guix.es.texi
-r--r--r--  2 root root 1388798 Jan  1  1970 guix.fa.texi
-r--r--r-- 17 root root 1019672 Jan  1  1970 guix.fr.texi
-r--r--r--  2 root root 1388646 Jan  1  1970 guix.it.texi
-r--r--r--  2 root root 1389421 Jan  1  1970 guix.ko.texi
-r--r--r--  2 root root 1398923 Jan  1  1970 guix.pt_BR.texi
-r--r--r--  2 root root 1637169 Jan  1  1970 guix.ru.texi
-r--r--r--  2 root root 1388634 Jan  1  1970 guix.sk.texi
-r--r--r--  2 root root 1381081 Jan  1  1970 guix.zh_CN.texi