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

System not rebooting if sudo is present and --extra-files is used #431

Closed
madjam002 opened this issue Dec 4, 2024 · 2 comments · Fixed by #434
Closed

System not rebooting if sudo is present and --extra-files is used #431

madjam002 opened this issue Dec 4, 2024 · 2 comments · Fixed by #434

Comments

@madjam002
Copy link

When using --extra-files, I've noticed that the system is not rebooting automatically after installation.

I think the installation is failing at the point where the extra files are copied across

tar -C "$extraFiles" -cpf- . | runSsh "${maybeSudo} tar -C /mnt -xf- --no-same-owner"

Is maybeSudo supposed to be used here even in the kexec environment? As it's logging that the command cannot be found in the installer kexec environment.

Uninstalling sudo before running nixos-anywhere works fine.

@Zempashi
Copy link

Zempashi commented Dec 4, 2024

Perfect timing, I was encountering the issue as well right now. Workaround also works for me as I log in root before kexec.

@thenbe
Copy link

thenbe commented Dec 5, 2024

When using terraform all-in-one, this error is "flaky" - as in it occurs roughly 50% the time. I'm not sure why the error only occurs sometimes when I run terraform apply, and does not occur every time I run terraform apply.

Error Message

$ terraform apply
 │ Error: local-exec provisioner error
│
│   with module.deploy.module.deploy.module.install.null_resource.nixos-remote,
│   on .terraform/modules/deploy.deploy/terraform/install/main.tf line 28, in resource "null_resource" "nixos-remote":
│   28:   provisioner "local-exec" {
│
│ Error running command
│ '.terraform/modules/deploy.deploy/terraform/install/run-nixos-anywhere.sh
│ ': exit status 127. Output: [email protected]'...
│ copying path
│ '/nix/store/nf0pby1b7d72kk9xxql9pil95k7sdq76-shutdown-ramfs-contents.json'
│ to 'ssh://[email protected]'...
│ copying path
│ '/nix/store/1v9s1drarqpprm9c5nq80wqk6psl9ncv-unit-dbus.service' to
│ 'ssh://[email protected]'...
│ copying path
│ '/nix/store/7wryi41dwpvlx0ivnk1s1xw6hsanyyc8-unit-dbus.service' to
│ 'ssh://[email protected]'...
│ copying path '/nix/store/ifwjw8wnz9bhdbypb3qkzqnvx8y326c3-user-units' to
│ 'ssh://[email protected]'...
│ copying path '/nix/store/x6rw9rcwkvi23s039icw23p3xq44i561-system-units' to
│ 'ssh://[email protected]'...
│ copying path '/nix/store/4lhd4p3x8i6xrc1l5kzl11w35s3q1gcx-etc' to
│ 'ssh://[email protected]'...
│ copying path
│ '/nix/store/hn7h3b7zjm79xvbvdbws917zd5m2hksp-nixos-system-foo-24.11.20241014.a3c0b3b'
│ to 'ssh://[email protected]'...
│ ### Copying extra files ###
│ bash: line 1: sudo: command not found

phaer added a commit to phaer/nixos-remote that referenced this issue Dec 10, 2024
There seems to be no scenario where we aren't root on the target
system at this point.

But there is one where it breaks: If hasSudo is true because the
pre-kexec env had it, but kexec env does not. See
nix-community#431
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

Successfully merging a pull request may close this issue.

3 participants