-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
fix(tailscale): startup race condition causes transient 'Command failed: tailscale status --json' errors #42798
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Summary
When the gateway starts with
gateway.tailscale.mode: "serve", the startup sequence runs several tailscale commands in rapid succession:findTailscaleBinary():which tailscale→tailscale --version(binary verification)enableTailscaleServe():tailscale serve --bg --yes <port>getTailnetHostname():tailscale status --jsonUnder any system load (e.g., during a gateway restart, or when
openclaw statusis called), step 3 transiently fails with a non-zero exit code, logged asCommand failed: tailscale status --json(visible because verbose/debug logging is enabled).Environment
/opt/homebrew/bin/tailscale, v1.94.1)/var/run/tailscaled.socket(permissions:srw-rw-rw-)gateway.tailscale.mode: "serve"Reproduction
Occurs reliably on every gateway restart. The sequence works fine in isolation — the failure is specific to the rapid back-to-back execution during startup under load.
Impact
startGatewayTailscaleExposurewraps in try/catch), so the gateway continues to functionSuggested Fix
Add a small retry/backoff between
enableTailscaleServeandgetTailnetHostname, or retryreadTailscaleStatusJsonon transient failures. A 1-2 retry with a short delay (e.g. 500ms) would eliminate the race without meaningfully slowing startup.Alternatively, expose a config option for the tailscale binary path (e.g.
gateway.tailscale.binaryPath) so users on non-standard setups can skip the discovery chain entirely.