{"record":{"id":"e2fabff9bd579b26","repo":"diegosouzapw/OmniRoute","slug":"tailscaled-did-not-become-ready","errorCode":null,"errorMessage":"tailscaled did not become ready","messagePattern":"tailscaled did not become ready","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/tailscaleTunnel.ts","lineNumber":614,"sourceCode":"    throw new Error(\"Sudo password required to start tailscaled\");\n  }\n\n  setCachedPassword(password);\n  await ensureTailscaleDir();\n\n  const command = [\n    `mkdir -p ${shellEscape(getTailscaleDir())}`,\n    `nohup ${shellEscape(daemonBinary)} --socket=${shellEscape(getTailscaleSocketPath())} --statedir=${shellEscape(getTailscaleDir())} >> ${shellEscape(getLogFilePath())} 2>&1 & echo $! > ${shellEscape(getPidFilePath())}`,\n  ].join(\" && \");\n\n  await runSudoShell(command, password);\n  await sleep(3000);\n\n  // Re-probe socket after starting\n  invalidateSocketCache();\n\n  if (!(await getLiveStatusPayload(resolution.binaryPath))) {\n    throw new Error(\"tailscaled did not become ready\");\n  }\n\n  const pid = await readPidFile();\n  await updateStateFile({\n    binaryPath: resolution.binaryPath,\n    installSource: resolution.installSource,\n    daemonPid: pid,\n    lastError: null,\n  });\n\n  return { started: true };\n}\n\nexport async function startTailscaleLogin({\n  hostname,\n}: {\n  hostname?: string;\n} = {}): Promise<TailscaleLoginResult> {","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/tailscaleTunnel.ts#L596-L632","documentation":"Readiness-verification failure after launching tailscaled: the daemon was spawned under sudo (nohup, socket+statedir configured), the socket cache was invalidated, and a 3s settle elapsed — yet getLiveStatusPayload still cannot reach the daemon. tailscaled either crashed on startup (bad state dir, port conflict) or is too slow to open its socket.","triggerScenarios":"Thrown at src/lib/tailscaleTunnel.ts:614 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Tailscale log file for daemon crash reasons","Retry after ensuring no stale socket/pid file blocks startup","Verify the state directory is writable by root and not corrupted"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}