Closed RafaelKr closed 1 week ago
Hi @RafaelKr,
I cloned your repo and installed Caddy, but couldn't reproduce your issue.
Can you please share the log?
What is your $SHELL
This is my Shell info:
This is how it looks for me:
This is the output of cat /nix/store/liy6ihhqf1mnr1ljlvcdhb3k43av8qbi-caddy
:
#!/nix/store/a1s263pmsci9zykm5xcdf7x9rv26w6d5-bash-5.2p26/bin/bash
XDG_DATA_HOME="/path/to/process-compose-is-elevated-repro/.devenv/state/caddy/data" XDG_CONFIG_HOME="/path/to/process-compose-is-elevated-repro/.devenv/state/caddy/config" /nix/store/7ad29pl6dsmpjkphkv4q7n3pp63g3v7w-caddy-2.7.6/bin/caddy run --config /nix/store/53zj25rq3h5vmlgddpdfih4mj856bl00-caddy-config.json
Can you please share the process compose log?
With devenv:
$ ~ cat /tmp/nix-shell.B8Upaf/process-compose-rafael.log
24-08-16 16:39:19.241 INF Process Compose v1.18.0
24-08-16 16:39:19.241 INF Loaded project from /nix/store/v41r99nfajsdybx2m11bxqz3qrfllvjn-process-compose.yaml
24-08-16 16:39:19.241 INF Global shell command: bash -c
24-08-16 16:39:19.241 INF start UDS http server listening /run/user/1000/devenv-a45632c/pc.sock
24-08-16 16:39:19.242 DBG Spinning up 2 processes. Order: ["caddy" "sleep"]
24-08-16 16:39:19.242 INF Started command=["bash","-c","sudo -S exec /nix/store/liy6ihhqf1mnr1ljlvcdhb3k43av8qbi-caddy"] process=caddy
24-08-16 16:39:19.242 INF Started command=["bash","-c","exec /nix/store/yljzwniixbw2vwyz8nn9dbr2vpslvsf1-sleep"] process=sleep
24-08-16 16:39:24.604 DBG Set password for elevated process caddy
24-08-16 16:39:24.608 INF Password accepted process=caddy
24-08-16 16:39:24.608 INF Exited exit_code=1 process=caddy
Without devenv:
$ ~ cat /tmp/process-compose-rafael.log
24-08-16 16:37:00.121 INF Process Compose v1.18.0
24-08-16 16:37:00.121 INF Loaded project from /home/rafael/coding/open-source/github.com/F1bonacc1/process-compose-is-elevated-repro/process-compose.yaml
24-08-16 16:37:00.121 INF Global shell command: bash -c
24-08-16 16:37:00.121 INF start http server listening :8080
24-08-16 16:37:00.121 DBG Spinning up 2 processes. Order: ["caddy" "sleep"]
24-08-16 16:37:00.122 INF Started command=["bash","-c","sleep 3600"] process=sleep
24-08-16 16:37:00.122 INF Started command=["bash","-c","sudo -S caddy run --config ./Caddyfile"] process=caddy
24-08-16 16:37:04.123 DBG Set password for elevated process caddy
24-08-16 16:37:04.134 INF Password accepted process=caddy
24-08-16 16:37:04.135 INF Exited exit_code=1 process=caddy
I was trying to repro without devenv.
What is the error when running without devenv? I see that it runs a different command, without exec
.
It's the same error. But I also have to say that it's still using caddy and process-compose from the /nix/store. Maybe I should try if I can also reproduce it when I really install both as system packages without nix. Although I won't have time to do it today.
I was able to repro it with:
bash -c 'sudo exec echo $PATH'
sudo: exec: command not found
I am not sure why devenv adds exec
.
Are you sure you are having the same issue without devenv
?
Good catch! It's coming from here: https://github.com/cachix/devenv/blob/b285601679c7686f623791ad93a8e0debc322633/src/modules/process-managers/process-compose.nix#L60
And was introduced with this commit: https://github.com/cachix/devenv/commit/78766e0df9ba0ff1923511b288d0489ba2d3a077
I just could work around it by updating my devenv.nix: https://github.com/RafaelKr/process-compose-is-elevated-repro/commit/fa283f213976242d00cdb1260e2c581cea72f565
Looks like it's a bug for devenv.
Edit: There we go https://github.com/cachix/devenv/issues/1391
A fix for devenv was merged: https://github.com/cachix/devenv/pull/1404
It'll be included in the next release probably.
Defect
This is a follow up to https://github.com/F1bonacc1/process-compose/issues/190#issuecomment-2259068786
Make sure that these boxes are checked before submitting your issue -- thank you!
process-compose info
)Version of
process-compose
:1.18.0 (same issue with 1.9.0)
OS environment:
Linux Mint 21.3 nix (Nix) 2.22.0
Steps or code to reproduce the issue:
With devenv
devenv up
Without devenv
process-compose
Expected result:
process-compose should ask for a password, then start caddy
Actual result:
process-compose asks for a password and then the caddy process fails with
sudo: exec: command not found