On the newest version of flox at time of writing (1.3.17) on Fedora 41, I run into an issue where flox occasionally hangs during activation. I’m having trouble tracking down the cause so I’ll list some symptoms and facts about my setup and hopefully that will be helpful.
- I’ve installed flox declaratively through the Nix/Generick setup via a home-manager flake.
- I’m running Determinate Nix
- The environment I’m activating it in can resolve and build, and activates sometimes. Usually the first try or two is fine. Then future attempts at activation hang later in the day (but not always. For instance, while writing this post I tried adding --mode=run to triage. The first time I added this the flox activation succeeded, the second time and onward it failed).
- I only have this issue with 1 of my flox environments. It has some dev packages defining dependencies on a few languages, some defined variables, and some defined services.
- After the issue appears, I have tried removing various parts of the flox config from the manifest as part of triage, but that has not resolved the issue.
given flox activate --start-services -vv
this is where it hangs:
+ declare -r _flox_shell=/bin/bash
+ unset FLOX_SHELL
+ case "$_flox_shell" in
++ /nix/store/jzwgipqqh04hawnma4z54g6hnzyxh314-flox-activations-1.3.17/bin/flox-activations start-or-attach --runtime-dir /run/user/1000 --pid 294327 --flox-env /home/userName/project/path/.flox/run/x86_64-linux.projectName.dev --store-path /nix/store/5x1lh4q4ybyv2cjaijdnq5b3swacllly-environment-develop
Interestingly enough, if I run sudo /home/userName/.nix-profile/bin/flox activate
the flox environment starts correctly.
However, if I run sudo /home/userName/.nix-profile/bin/flox activate --start-services
the flox environment still hangs, but at a different place.
2025-04-08T19:44:45.400380Z DEBUG flox_rust_sdk::models::environment: detected concrete environment type: path
2025-04-08T19:44:45.400561Z DEBUG flox_rust_sdk::providers::services: running process-compose process list cmd=env NO_COLOR=1 PATH=/nix/store/gnf4wjrn5g17gzch44ycvb83ci4s8a6z-process-compose-1.40.1/bin/process-compose /nix/store/gnf4wjrn5g17gzch44ycvb83ci4s8a6z-process-compose-1.40.1/bin/process-compose --unix-socket /run/user/0/flox.0b6c17ad.sock process list --output json
Which makes me think it may be one of my services causing the issue. The only “unusual” service I added to my manifest recently is an ssh tunnel that I launch on environment activation i.e.:
[services.tunnel]
command = "ssh -N -L port:host:port host"
is-daemon = true
shutdown.command = "killall ssh"
Could that be causing an issue?
Is this possibly a permissions issue? What additional steps might I try to further triage or mitigate this issue?