serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.22k stars 100 forks source link

Seems to break when using `Nushell` as default shell on target machine. #237

Closed crabdancing closed 9 months ago

crabdancing commented 9 months ago

I believe the argument handling logic for communicating with the activate side of deploy-rs is not robust against novel shells like Nushell. Here is a snippet of the relevant log:

error: Found argument '/nix/var/nix/profiles/system' which wasn't expected, or isn't valid in this context

If you tried to supply `/nix/var/nix/profiles/system` as a PATTERN use `-- /nix/var/nix/profiles/system`

USAGE:
    activate activate [FLAGS] [OPTIONS] <closure> --confirm-timeout <confirm-timeout> --temp-path <temp-path> <--profile-path <profile-path>|--profile-user <profile-user>>

For more information try --help
👀 ℹī¸[wait] [INFO] Waiting for confirmation event...
🚀 ❌ [deploy] [ERROR] Activating over SSH resulted in a bad exit code: Some(2)
🚀 ℹī¸[deploy] [INFO] Revoking previous deploys
🚀 ❌ [deploy] [ERROR] Deployment failed, rolled back to previous generation
crabdancing commented 9 months ago

Er... looks like it might not be a Nushell related issue? I ran with -d to get the activation command and tried to run it myself on the remote system, using Bash instead of Nushell. But it gives me the same error:

root@🌐 mgf1 ~
ī†˛ ❯ /nix/store/k88knl2s5k5qwl0dyp77yvywrr1pqgi0-activatable-nixos-system-mgf1-23.05.20230915.360a7d3/activate-rs --debug-logs activate '/nix/store/k88knl2s5k5qwl0dyp77yvywrr1pqgi0-activatable-nixos-system-mgf1-23.05.20230915.360a7d3' '/nix/var/nix/profiles/system' --temp-path '/tmp' --confirm-timeout 30 --magic-rollback --auto-rollback
error: Found argument '/nix/var/nix/profiles/system' which wasn't expected, or isn't valid in this context

If you tried to supply `/nix/var/nix/profiles/system` as a PATTERN use `-- /nix/var/nix/profiles/system`

USAGE:
    activate activate [FLAGS] [OPTIONS] <closure> --confirm-timeout <confirm-timeout> --temp-path <temp-path> <--profile-path <profile-path>|--profile-user <profile-user>>

For more information try --help
crabdancing commented 9 months ago

Ah, got it working by testing against master repo's nix flake. Guess that's what I get for trying to use nixpkgs. :P

mariaa144 commented 9 months ago

I had to use nixos/nixpkgs/nixos-unstable instead of nixos/nixpkgs/nixos-23.05.