Subject: bug#40082: guix offload error messages need improvements

From: [email-masked]
Date: Sun, 15 Mar 2020 19:57:07 +0100

Hi Guix,

guix offload error messages are cumbersome. With a help from guys on irc channel(many thanks), I finally manage it to work by installing guix and guile packages under the remote user.

--8<---------------cut here---------------start------------->8---
# local
aabramov@delta:~/factory/guix$ guix describe
Generation 340	Mar 12 2020 18:23:16	(current)
  guix be78906
    repository URL: file:///home/aabramov/factory/guix
    branch: master
    commit: be78906592c761aa2a67e979074561e459efdcac
# remote
[aabramov@minion100 ~]$ guix describe
Generation 2	Mar 15 2020 17:42:04	(current)
  guix be78906
    repository URL: file:///home/aabramov/guix
    branch: master
    commit: be78906592c761aa2a67e979074561e459efdcac
--8<---------------cut here---------------end--------------->8---

machines.scm is ready, and here is my fist attempt to run offload test.

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'minion100' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'minion100' is running GNU Guile 3.0.1
guix offload: error: failed to connect to `#<input-output: channel (open) 7fc8c903a260>': Protocol error
--8<---------------cut here---------------end--------------->8---

There is no errors in my local guix-daemon nor remote one. --debugs doesn't help either

Same thing with copy.

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ guix copy --to=minion100 hello
guix copy: error: failed to connect to `#<input-output: channel (open) 7f64d7d18de0>': Protocol error
aabramov@delta:~/factory/guix$ guix copy --from=minion100 hello
guix copy: error: failed to connect to `#<input-output: channel (open) 7f314e202cc0>': Protocol error
--8<---------------cut here---------------end--------------->8---

Guix says that my minion is running GNU Guile 3.0 which is for me a good sign, but apparently it is not.

I thought that guile 3.0 is an issues, so let's install guile-2. Here is my remote profile:

--8<---------------cut here---------------start------------->8---
[aabramov@minion100 ~]$ guix package -l
Generation 1	Mar 09 2020 22:22:03
  glibc-locales	2.29	out	/gnu/store/03nvilh2x4z07dxv7h13gh986vvgpnsf-glibc-locales-2.29

Generation 2	Mar 09 2020 22:28:46
 + emacs-next	27.0.50-0.36abf68	out	/gnu/store/61bwd5sn4s25lm2m9shbrja5d6z1d17y-emacs-next-27.0.50-0.36abf68

Generation 3	Mar 15 2020 16:54:24
 + sshuttle	0.78.5	out	/gnu/store/13s2jadhdvpk99mnkf6y1r42mamijzrd-sshuttle-0.78.5

Generation 4	Mar 15 2020 17:56:00
 + guile	2.2.7	out	/gnu/store/jgl9d4axpavsv83z2f1z1himnkbsxxqj-guile-2.2.7
--8<---------------cut here---------------end--------------->8---

guix offload test fails with a diffrent error. I also tried to use #:log-verbosity 'protocol, but it doesn't help.

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'minion100' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'minion100' is running GNU Guile 3.0.1
sending 1 store item (0 MiB) to 'minion100'...
exporting path `/gnu/store/wc2vv8kcf634gijak07sadwmkck903lq-export-test'
guix offload: error: unknown error while sending files over SSH
--8<---------------cut here---------------end--------------->8---

In the meantime copy fails differently:

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ guix copy --from=minion100 hello
guix copy: error: Guile modules not found on remote host 'minion100'
hint: Make sure `GUILE_LOAD_PATH' includes Guix' own module directory.  Run `ssh minion100 env | grep GUILE_LOAD_PATH' to check.

aabramov@delta:~/factory/guix$ guix copy --to=minion100 hello
sending 1 store item (0 MiB) to 'minion100'...
guix copy: error: unknown error while sending files over SSH
aabramov@delta:~/factory/guix$ ssh minion100 env | grep GUILE_LOAD_PATH
--8<---------------cut here---------------end--------------->8---

`copy from' check gives a hint, but even though I have GUIX_PROFILE defined in my .bash_profile:

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ ssh minion100 tail -n2 .bash_profile 
export GUIX_PROFILE=~/.guix-profile
source "${GUIX_PROFILE}/etc/profile"
--8<---------------cut here---------------end--------------->8---

for some reason I still don't have any GUILE_LOAD variables defined

--8<---------------cut here---------------start------------->8---
[aabramov@minion100 ~]$ cat .guix-profile/etc/profile
# Source this file to define all the relevant environment variables in Bash
# for this profile.  You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#
#  GUIX_PROFILE=/path/to/profile ; \
#  source /path/to/profile/etc/profile
#
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.

export PATH="${GUIX_PROFILE:-/gnu/store/lz99sh2a2kgcxb7wr5lf2vk9yzwb9lmm-profile}/bin${PATH:+:}$PATH"
export EMACSLOADPATH="${GUIX_PROFILE:-/gnu/store/lz99sh2a2kgcxb7wr5lf2vk9yzwb9lmm-profile}/share/emacs/site-lisp:${GUIX_PROFILE:-/gnu/store/lz99sh2a2kgcxb7wr5lf2vk9yzwb9lmm-profile}/share/emacs/27.0.50/lisp${EMACSLOADPATH:+:}$EMACSLOADPATH"
export INFOPATH="${GUIX_PROFILE:-/gnu/store/lz99sh2a2kgcxb7wr5lf2vk9yzwb9lmm-profile}/share/info${INFOPATH:+:}$INFOPATH"
--8<---------------cut here---------------end--------------->8---

OK, I saw some notes about guile-ssh and decided to install it. It seems like guix adds GUILE_LOAD vars only when you install some guile libs.

--8<---------------cut here---------------start------------->8---
[aabramov@minion100 ~]$ guix package -l
Generation 1	Mar 09 2020 22:22:03
  glibc-locales	2.29	out	/gnu/store/03nvilh2x4z07dxv7h13gh986vvgpnsf-glibc-locales-2.29

Generation 2	Mar 09 2020 22:28:46
 + emacs-next	27.0.50-0.36abf68	out	/gnu/store/61bwd5sn4s25lm2m9shbrja5d6z1d17y-emacs-next-27.0.50-0.36abf68

Generation 3	Mar 15 2020 16:54:24
 + sshuttle	0.78.5	out	/gnu/store/13s2jadhdvpk99mnkf6y1r42mamijzrd-sshuttle-0.78.5

Generation 4	Mar 15 2020 17:56:00
 + guile	2.2.7	out	/gnu/store/jgl9d4axpavsv83z2f1z1himnkbsxxqj-guile-2.2.7

Generation 5	Mar 15 2020 18:02:58	(current)
 + guile-ssh	0.12.0	out	/gnu/store/qqpigisk01ivzvb9pyi4d4d6v5p6djzw-guile-ssh-0.12.0
--8<---------------cut here---------------end--------------->8---

So now I have all the vars in place, but the copy command still complains:

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ ssh minion100 env | grep GUILE_
GUILE_LOAD_PATH=/home/aabramov/.guix-profile/share/guile/site/2.2
GUILE_LOAD_COMPILED_PATH=/home/aabramov/.guix-profile/lib/guile/2.2/site-ccache

aabramov@delta:~/factory/guix$ guix copy --from=minion100 hello
guix copy: error: Guile modules not found on remote host 'minion100'
hint: Make sure `GUILE_LOAD_PATH' includes Guix' own module directory.  Run `ssh minion100 env | grep GUILE_LOAD_PATH' to check.

aabramov@delta:~/factory/guix$ guix copy --to=minion100 hello
sending 1 store item (0 MiB) to 'minion100'...
guix copy: error: unknown error while sending files over SSH
--8<---------------cut here---------------end--------------->8---

Finally guix installation does the trick:

--8<---------------cut here---------------start------------->8---
aabramov@delta:~/factory/guix$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'minion100' (test returned "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'minion100' is running GNU Guile 2.2.6
sending 1 store item (0 MiB) to 'minion100'...
exporting path `/gnu/store/9lj51ppm9a92yfk7jxpv4vjqpcpbcxh6-export-test'
guix offload: 'minion100' successfully imported '/gnu/store/9lj51ppm9a92yfk7jxpv4vjqpcpbcxh6-export-test'
retrieving 1 store item from 'minion100'...
guix offload: successfully imported '/gnu/store/877wz9nrnpk8zljj8gzvvlnpwlg01240-import-test' from 'minion100'
aabramov@delta:~/factory/guix$ guix copy --to=minion100 hello
sending 1 store item (0 MiB) to 'minion100'...
/gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10
aabramov@delta:~/factory/guix$ guix copy --from=minion100 hello
retrieving 0 store items from 'minion100'...
--8<---------------cut here---------------end--------------->8---

--
Alexey