Re: shepherd-action debug help needed

2023-10-31 Thread Attila Lendvai
> Exit code 127 means "command not found". [1] More information is
> available in stderr (or sometimes stdout) if you can capture it.

but how come binaries are not found when i have the full path for the 
commands...?

the install binary is only used to set the umask of the result. without it, a 
simple invokation of tar also fails, even without --gzip.

i dug a bit deeper, and it turned out that the SYSTEM call i thought was coming 
from guile was rebound by shepherd to point to its own SPAWN-SHELL-COMMAND. 
through various complex code paths, it ends up calling fork+exec-command. 
SPAWN-SHELL-COMMAND's role is to make the SYSTEM call non-blocking.

as a quick test, i have added a simple (system "ls -l /bin/sh") call to my 
action, and that fails, too.

i'll need to add proper logging to shepherd and see what's going wrong. but for 
that i need https://issues.guix.gnu.org/61750 merged.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Justice is not concerned with the results of the various transactions, but 
only with whether the transactions themselves are fair.”
— F.A. Hayek (1899–1992), 'Law, Legislation and Liberty', I.6.j




Re: shepherd-action debug help needed

2023-10-30 Thread Development of GNU Guix and the GNU System distribution.
Hi Attila,

On Mon, Oct 30 2023, Attila Lendvai wrote:

> 2023-10-30T14:24:12 Cmd returned exit code 127

Exit code 127 means "command not found". [1] More information is
available in stderr (or sometimes stdout) if you can capture it.

Another option would be to forgo the shell magic in (system cmd-string)
and reimplement that call using system*, open-pipe* and friends. The
"install" step could become a Guile loop over the file names. The
deconstruction might likewise help you pinpoint the command that fails
because the executable was not found.

Kind regards
Felix

[1] https://linuxconfig.org/how-to-fix-bash-127-error-return-code



shepherd-action debug help needed

2023-10-30 Thread Attila Lendvai
dear guixers,

i have a custom shepherd action that calls tar with (system ...):

https://github.com/attila-lendvai/guix-crypto/blob/staging/src/guix-crypto/services/swarm.scm#L311

it works fine in a `guix system vm` environment, where i'm usually testing it. 
but when i pull it to my server, it fails with exit code 127.

it has logging:

2023-10-30T14:24:12 Will run backup cmd: "install --mode=600 
<(/gnu/store/iiyf5ns10j8sgzfpmcgbfyb0byk5sbjl-tar-1.34/bin/tar --verbose 
--create --directory /var/lib/swarm/mainnet/bee-0 keys/ statestore/ | 
/gnu/store/gjsxzcc0gqpz4lpbsrbidlnn5ij1lfm1-gzip-1.12/bin/gzip) 
/tmp/2023-10-30-serlap-bee-mainnet-0.tgz", PATH is 
/gnu/store/d4rqw481nwvrzs09nd8ad647nczgm9k1-coreutils-9.1/bin:/gnu/store/gjsxzcc0gqpz4lpbsrbidlnn5ij1lfm1-gzip-1.12/bin,
 uid is 0
2023-10-30T14:24:12 Cmd returned exit code 127

if i copy-paste the above command into the same root prompt from where i'm 
invoking `herd backup-identity bee-0 /tmp/`, then it works as expected. even if 
i prefix it with `PATH="" ...`.

my question is:

what could be the difference between running a `guix system vm` from my git 
checkout, and guix pull'ing the same to a proper guix system?

could it be file or other permissions? according to the log, (getuid) is 0 when 
the action is executed.

alternatively, how could i debug this?

for completeness, this is how i start the system vm test:

$(./pre-inst-env guix system --no-graphic vm 
--share=$HOME/workspace/guix/var-lib-of-guest-vm=/var/lib 
~/workspace/guix/guix-crypto/tests/swarm-tests.scm) -m 2048

and this is the file:

https://github.com/attila-lendvai/guix-crypto/blob/staging/tests/swarm-tests.scm

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Tyranny is defined as that which is legal for the government but illegal for 
the citizenry.”
— Thomas Jefferson (1743–1826)