Menu

#96 installer: fails on Windows when MCP server process is already running (binary file lock)

closed
nobody
None
2026-04-20
2026-04-08
Anonymous
No

Originally created by: kumaakh

Summary

On Windows, reinstalling apra-fleet while the MCP server is running fails because the OS holds a file lock on the executing binary. The installer cannot overwrite `apra-fleet.exe` while it is in use.

Reproduction

  1. Install apra-fleet — MCP server starts (registered in Claude Code, loaded automatically).
  2. Download a newer binary.
  3. Run `apra-fleet-win-x64.exe install` with the MCP server still running.
  4. Installer fails when trying to replace the binary (access denied / file in use).

Root cause

Windows locks executables while they are running. `apra-fleet.exe` is loaded as an MCP server by Claude Code, so it remains running in the background. Any attempt to overwrite it during installation hits a file-lock error.

Expected behaviour

The installer detects a running MCP server process and either stops it automatically (with `--force`) or prompts the user to stop it manually.

Proposed fix

`--force` flag

Add `apra-fleet install --force` that kills the running server before replacing the binary:

  • On Windows: `taskkill /F /IM apra-fleet.exe`
  • On macOS/Linux: `pkill -f apra-fleet`

Then replaces the binary and prints instructions to restart Claude Code.

Busy/running prompt (without `--force`)

When the installer detects a running process and `--force` was not passed, show a clear error:

```
Error: apra-fleet is currently running (MCP server process detected).
Stop it first, or re-run with --force to kill it automatically:

apra-fleet install --force

On Windows you can also run: taskkill /F /IM apra-fleet.exe
```

Steps

  1. Before copying the binary, check if a fleet process is running.
  2. If `--force`: kill it, proceed with install, print "Restart Claude Code to reload the MCP server."
  3. If not `--force`: print the prompt above and exit with a non-zero code.

Acceptance criteria

  • [ ] `apra-fleet install` on a running server shows the prompt with `--force` hint
  • [ ] `apra-fleet install --force` kills the running server and completes install
  • [ ] Works on Windows (taskkill) and macOS/Linux (pkill)
  • [ ] Post-install message reminds user to restart Claude Code / run `/mcp`
  • [#95] — installer fails at step 5 if MCP entry already exists in config (separate issue, different root cause)

Related

Tickets: #105
Tickets: #143
Tickets: #95

Discussion

  • Anonymous

    Anonymous - 2026-04-20

    Originally posted by: kumaakh

    Fixed in commit 211f043 (PR [#128]). apra-fleet install now detects a running server and shows a clear error with the --force hint. apra-fleet install --force kills the running process and completes the install on all platforms.

     

    Related

    Tickets: #128

  • Anonymous

    Anonymous - 2026-04-20

    Ticket changed by: kumaakh

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB