serokell / deploy-rs

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

Trying to deploy config fails with 'found argument --profile-user which wasn't expected' #232

Closed TheNeikos closed 9 months ago

TheNeikos commented 9 months ago

The output:

✦ ❯ nix run github:serokell/deploy-rs -- --skip-checks .#flutters
πŸš€ β„Ή [deploy] [INFO] Evaluating flake in .
warning: Git tree '/home/neikos/projects/servers' is dirty
trace: warning: Enabling both boot.enableContainers & virtualisation.containers on system.stateVersion < 22.05 is unsupported.

πŸš€ β„Ή [deploy] [INFO] The following profiles are going to be deployed:
[flutters.system]
user = "root"
ssh_user = "root"
path = "/nix/store/bb4csiqr662xpmah6zq2l1553avzsmri-activatable-nixos-system-flutters-23.05.20230820.475d5ae"
hostname = "100.89.240.44"
ssh_opts = []

πŸš€ β„Ή [deploy] [INFO] Building profile `system` for node `flutters`
[1/21/26 built, 8 copied (102.2/102.2 MiB), 19.4 MiB DL] building man-cache
πŸš€ β„Ή [deploy] [INFO] Copying profile `system` to node `flutters`
πŸš€ β„Ή [deploy] [INFO] Activating profile `system` for node `flutters`
πŸš€ β„Ή [deploy] [INFO] Creating activation waiter
error: Found argument '--profile-user' which wasn't expected, or isn't valid in this context

If you tried to supply `--profile-user` as a PATTERN use `-- --profile-user`

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

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

This was working in d0cfc042eba92eb206611c9e8784d41a2c053bab, so was introduced in the commits after.

rvem commented 9 months ago

Seems like a breaking change from https://github.com/serokell/deploy-rs/pull/231 which was needed to fix #201 (which is a breaking change on this nix side). Please consider updating deploy-rs input, this should fix the error that you observe

rvem commented 9 months ago

Apparently, deploy-rs now deserves an update in nixpkgs

TheNeikos commented 9 months ago

Yup! That was the problem.

Is there an easy trick I can do that allows me to re-export the deploy-rs binary? (I could just add it to my own apps I guess)

rvem commented 9 months ago

Is there an easy trick I can do that allows me to re-export the deploy-rs binary?

I personally tend to add deploy-rs to the devShell and then run nix develop -c deploy .#<blah> instead of nix run

Thus deployments profiles are always up-to-date with deploy-rs binary(s)

fherenius commented 9 months ago

Sorry to bump a closed issue, but I'm running into the same errors and from the conversation it's unclear to me how exactly this should be solved. NixOS is new to me, so I might be missing something obvious.

Do I have to update the deploy-rs binary on my node?

TheNeikos commented 9 months ago

Sorry to bump a closed issue, but I'm running into the same errors and from the conversation it's unclear to me how exactly this should be solved. NixOS is new to me, so I might be missing something obvious.

Do I have to update the deploy-rs binary on my node?

The β€œdeploy” binary you run needs to be up to date with the library that you use as input in your flake.