Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
patryk4815 opened this issue Feb 10, 2024 · 2 comments
Open

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

patryk4815 opened this issue Feb 10, 2024 · 2 comments

Comments

@patryk4815
Copy link

patryk4815 commented Feb 10, 2024

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

command:
nix run github:nix-community/nixos-anywhere -- --flake .#a1 --debug [email protected]

++ 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 [email protected] -- 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 [email protected] -- 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 [email protected] -- exit 0
Warning: Permanently added '64.176.69.177' (ED25519) to the list of known hosts.
+ [email protected]
+ ssh_ -o ConnectTimeout=10 -- exit 0
+ ssh -t -i /tmp/tmp.svnmdxFSXe/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected] -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://[email protected] /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://[email protected] /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
@EmergentMind
Copy link

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
Copy link

stv0g commented Sep 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants