nix-community/nixos-anywhere

Stuck with: `Couldn't execute zsh -c "echo started"`

Opened this issue · 2 comments

Maybe related with #251
But I don't know how to fix it.

command:
nix run github:nix-community/nixos-anywhere -- --flake .#a1 --debug root@64.176.69.177

++ uname -r
sort: -:2: nieuporządkowanie: 3.10.0-1160.108.1.el7.x86_64
+ printf '%s\n' 6.1 3.10.0-1160.108.1.el7.x86_64
+ /root/kexec/kexec/kexec --load /root/kexec/kexec/bzImage '' --initrd=/root/kexec/kexec/initrd --no-checks --command-line 'init=/nix/store/b89g0yk4fgsspacaaf28clj8ii7p88w3-nixos-system-nixos-23.11pre-git/init console=tty0 console=ttyS0,115200 loglevel=4'
machine will boot into nixos in 6s...
+ echo 'machine will boot into nixos in 6s...'
+ test -e /dev/kmsg
+ exec
+ timeout_ssh_ -- exit 0
+ timeout 10 ssh -i /tmp/tmp.svnmdxFSXe/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@64.176.69.177 -- exit 0
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
+ sleep 1
+ timeout_ssh_ -- exit 0
+ timeout 10 ssh -i /tmp/tmp.svnmdxFSXe/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@64.176.69.177 -- exit 0
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
+ sleep 1
+ timeout_ssh_ -- exit 0
+ timeout 10 ssh -i /tmp/tmp.svnmdxFSXe/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@64.176.69.177 -- exit 0
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
+ ssh_connection=root@64.176.69.177
+ ssh_ -o ConnectTimeout=10 -- exit 0
+ ssh -t -i /tmp/tmp.svnmdxFSXe/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@64.176.69.177 -o ConnectTimeout=10 -- exit 0
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
Connection to 64.176.69.177 closed.
+ [[ n == \y ]]
+ [[ -n /nix/store/n6jrfzv27ckga07hamkw8zis10a085hf-disko ]]
+ nix_copy --to ssh://root@64.176.69.177 /nix/store/n6jrfzv27ckga07hamkw8zis10a085hf-disko
+ NIX_SSHOPTS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /tmp/tmp.svnmdxFSXe/nixos-anywhere '
+ nix copy --extra-experimental-features 'nix-command flakes' --no-write-lock-file -L --substitute-on-destination --to ssh://root@64.176.69.177 /nix/store/n6jrfzv27ckga07hamkw8zis10a085hf-disko
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
Couldn't execute zsh -c "echo started": No such file or directory

Edit:
Works after adding:

export SHELL=/bin/sh

In case someone else encounters this issue and isn't knowledgeable about how to manipulate the SHELL environment variable, or is on a source machine that is configured to inject a specific shell to an ssh target, you can just prepend setting of the environment variable to the beginning of the nix run command as follows:

$ SHELL=/bin/sh nix run github:nix-community/nixos-anywhere -- --flake <path to configuration>#<configuration name> root@<ip address>

stv0g commented

I can confirm this. It also happens to me when using colmena.
So I dont believe its related to nixos-anywhere per se.
I also can not confirm that version discrepancies are the culprint as mentioned in #251