Skip to content

[Bug]: "Update all" with two servers on one machine races on a shared provider CLI; one fails with spawn NotFound (0.1.10) #38676

Closed

Description

@grahamfarrar

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Summary

When one desktop client is connected to two T3 servers on the same machine, "Update all" sends server.updateProvider to both at the same instant. The two servers share one install of each provider CLI, so both run the same update command against the same binary. If the CLI's updater replaces its own files, the second server's spawn can hit the moment the binary is missing and fail with NotFound. The pill then shows <server name> failed with no provider name or reason.

Steps to reproduce

  1. Run two T3 servers on one Mac (different base dirs and ports) and connect one desktop app to both.
  2. Have a provider CLI installed once for both, with an update available. Here it was Grok, installed globally with npm, so /opt/homebrew/bin/grok is a symlink into lib/node_modules/@xai-official/grok.
  3. Click "Update all".

Expected behavior

Both servers report the provider as updated. Either the updates for a shared binary run one at a time, or a spawn that fails with NotFound during another update of the same path is retried or treated as "already updating".

Actual behavior

One server fails within 2 ms and the pill shows <server name> failed with only "Dismiss". Timeline from the two servers' traces (local time, same machine):

  • 07:56:01.61-.63: both servers receive three server.updateProvider calls each, within 25 ms of each other.
  • 07:56:03.463: server A's third ProviderInstallationGate.update starts and runs 4.8 s. The grok symlink and its native binary both have mtimes inside this window (07:56 and 07:56:07).
  • 07:56:05.036: server B's ProviderInstallationGate.update fails after 2 ms with the error below.
  • 07:56:30: running the update again on server B succeeds in 2.2 s (Grok was already current).

The other two provider updates passed on both servers the first time. I haven't confirmed from the trace attributes that server A's 07:56:03 span was the Grok one; that's inferred from the timing and the file mtimes.

Impact

Minor bug or occasional failure. Retrying works, but the pill gives no hint about what failed or why.

Version or commit

0.1.10 (desktop and both servers)

Environment

macOS 27.2.1, Apple Silicon. Two servers on one machine sharing one home directory's provider CLIs. Grok CLI 1.0.89 after the update.

Logs or stack traces

ProviderMaintenanceCommandError: Failed to run update command /opt/homebrew/bin/grok: NotFound: ChildProcess.spawn (/opt/homebrew/bin/grok update)
    at ProviderMaintenanceRunner.collectCommandResult
    at ProviderMaintenanceRunner.runCommand
    at ProviderInstallationGate.update
    at ProviderMaintenanceRunner.runCommandAndVerify
    at ProviderMaintenanceRunner.runProviderUpdate

Workaround

Run the update again; the second attempt finds the CLI already updated.

Two possible fixes: a per-binary lock file around the update command so servers on one machine don't overlap, or having the pill name the provider and show the error so the retry is obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions