-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
nixos-rebuild with --target-host hangs in github action environment #262686
Comments
BTW, looking at your logs it seems I missed to preserve the bootloader updates inside the |
This works fine to me:
@duament Can you pass the |
I can only reproduce it without the --tty flag. Here's the logs
The second command without |
I believe it's not related to a systemd update since I can reproduce it by running the same command again without an actual system upgrade. |
Your configuration seems to be depending on See the reasoning here:
To workaround for now you can pass
Keep in mind that |
That $HOME related warning/error is from fish. It just complains my $HOME(/var/empty) is not writable. It will not exit with error. |
I guess it is fair:
Especially because it seems |
I will test |
BTW, from the So adding both flags seems correct in this case. |
I tried to add the flag diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index 9e75db6d27b5..cb616d3cf709 100755
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -663,6 +663,7 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" =
"--collect"
"--no-ask-password"
"--pty"
+ "--pipe"
"--quiet"
"--same-dir"
"--service-type=exec" But got stuck with some strange errors during tests:
Not sure what is happening here, maybe @roberth can help? For now I think one workaround can be to wrap the call to
|
BTW, I think we can substitute |
I think I found a way to fix the issue, opened a PR: #262985 |
I didn't work ( |
Investigating the test error: diff --git a/nixos/tests/nixos-rebuild-install-bootloader.nix b/nixos/tests/nixos-rebuild-install-bootloader.nix
index 3ade90ea24a..d1a01887f20 100644
--- a/nixos/tests/nixos-rebuild-install-bootloader.nix
+++ b/nixos/tests/nixos-rebuild-install-bootloader.nix
@@ -55,12 +55,12 @@ import ./make-test-python.nix ({ pkgs, ... }: {
"${configFile}",
"/etc/nixos/configuration.nix",
)
- machine.succeed("nixos-rebuild switch")
+ machine.succeed("stty -a 1>&2; nixos-rebuild switch; stty -a 1>&2; stty -echo")
# Need to run `nixos-rebuild` twice because the first run will install
# GRUB anyway
with subtest("Switch system again and install bootloader"):
- result = machine.succeed("nixos-rebuild switch --install-bootloader")
+ result = machine.succeed("stty -a 1>&2; nixos-rebuild switch --install-bootloader; stty -a 1>&2; stty -echo")
# install-grub2.pl messages
assert "updating GRUB 2 menu..." in result
assert "installing the GRUB 2 boot loader on /dev/vda..." in result
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index 9e75db6d27b..cb616d3cf70 100755
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -663,6 +663,7 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" =
"--collect"
"--no-ask-password"
"--pty"
+ "--pipe"
"--quiet"
"--same-dir"
"--service-type=exec" Found the tty settings being changed. Logs:
Logs diff: --- old 2023-10-25 08:59:07.693220929 +0800
+++ new 2023-10-25 08:59:05.455250752 +0800
@@ -3,8 +3,8 @@
machine # eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
machine # werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
machine # -parenb -parodd -cmspar cs8 hupcl -cstopb cread -clocal -crtscts
-machine # -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-machine # -iuclc -ixany -imaxbel -iutf8
-machine # -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-machine # -isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
+machine # -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff
+machine # -iuclc -ixany imaxbel iutf8
+machine # opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
+machine # isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop echoprt
machine # echoctl echoke -flusho -extproc I'll try to restore the settings and see if the test could pass. |
I'm getting an identical hang using Packer to produce EC2 EBS images; with a Packer HCL fragment containing:
I'm starting from the NixOS-23.05.555.52869451b83-* AMIs. I can confirm the |
Since upgrading to
it works fine, but if I run
then it hangs after this:
until I ctrl-C it. Looking at
and indeed (I assume the fact that I'm passing in a different nixpkgs with I have an effective workaround for my case (just running commands in |
Likely related to: NixOS/nixpkgs#262686
Likely related to: NixOS/nixpkgs#262686
Describe the bug
I've set up a github action to deploy nixos on remote hosts with command
But after #258571, it stops working.
The failed job https://github.com/duament/flakes/actions/runs/6598694622/job/17926924711 shows it hangs for about 2 hours and exit abnormally. On the target host I found
nixos-rebuild-switch-to-configuration.service
exited successfully but thesystemd-run
process hangs.I can also reproduce it locally with
systemd-run --user --same-dir nix run nixpkgs#nixos-rebuild -- --flake .#az --target-host deploy@az.rvf6.com --use-remote-sudo switch
.Might be related to tty.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Exit successfully
Screenshots
Additional context
Notify maintainers
@thiagokokada
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: