Skip to content

Environment always attaches after unexpected machine shutdown #2764

@mkenigs

Description

@mkenigs

First reported by @brendaneamon. His machine shutdown unexpectedly, so activations didn't exit cleanly. After that, his environment would always attach instead of starting a new activation, even after a reboot.

This can be reproduced by killing the watchdog manually. Note that the final activation attaches when it should start, and there is no watchdog running

/tmp  > flox init
✨ Created environment 'tmp' (aarch64-darwin)

Next:
  $ flox search <package>    <- Search for a package
  $ flox install <package>   <- Install a package into an environment
  $ flox activate            <- Enter the environment
  $ flox edit                <- Add environment variables and shell hooks

/tmp  > flox activate
✅ You are now using the environment 'tmp'.
To stop using this environment, type 'exit'

flox [tmp] /tmp  > ps -A | grep "$_FLOX_ACTIVATION_ID"
72746 ??       /nix/store/jdzgm1rc3aszpyyxpvw0rf7kndq2whjl-flox-watchdog-1.3.14/libexec/flox-watchdog --disable-metrics --log-dir /private/tmp/.flox/log --socket /Users/matthew/.cache/flox/run/flox.40132595.sock --flox-env /private/tmp/.flox/run/aarch64-darwin.tmp.dev --activation-id 9f1c5c78 --runtime-dir /Users/matthew/.cache/flox/run
76717 ttys000  grep 9f1c5c78

flox [tmp] /tmp  > kill -9 72746

/tmp  > flox activate
✅ Attached to existing activation of environment 'tmp'
To stop using this environment, type 'exit'

flox [tmp] /tmp  > ps -A | grep "$_FLOX_ACTIVATION_ID"
ps: time: requires entitlement
79483 ttys000  grep 9f1c5c78

Threads:

Possibly depends on:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteam-cliTickets relevant to the flox CLI team

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions