{"record":{"id":"38ebbae62f7e7970","repo":"louislam/uptime-kuma","slug":"no-output-from-tailscale-ping","errorCode":null,"errorMessage":"No output from Tailscale ping","messagePattern":"No output from Tailscale ping","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/tailscale-ping.js","lineNumber":40,"sourceCode":"     * Runs the Tailscale ping command to the given URL.\n     * @param {string} hostname The hostname to ping.\n     * @param {number} interval Interval to send ping\n     * @returns {Promise<string>} A Promise that resolves to the output of the Tailscale ping command\n     * @throws Will throw an error if the command execution encounters any error.\n     */\n    async runTailscalePing(hostname, interval) {\n        let timeout = interval * 1000 * 0.8;\n        let res = await childProcessAsync.spawn(\"tailscale\", [\"ping\", \"--c\", \"1\", hostname], {\n            timeout: timeout,\n            encoding: \"utf8\",\n        });\n        if (res.stderr && res.stderr.toString() && res.code !== 0) {\n            throw new Error(`Error in output: ${res.stderr.toString()}`);\n        }\n        if (res.stdout && res.stdout.toString()) {\n            return res.stdout.toString();\n        } else {\n            throw new Error(\"No output from Tailscale ping\");\n        }\n    }\n\n    /**\n     * Parses the output of the Tailscale ping command to update the heartbeat.\n     * @param {string} tailscaleOutput The output of the Tailscale ping command.\n     * @param {object} heartbeat The heartbeat object to update.\n     * @returns {void}\n     * @throws Will throw an eror if the output contains any unexpected string.\n     */\n    parseTailscaleOutput(tailscaleOutput, heartbeat) {\n        let lines = tailscaleOutput.split(\"\\n\");\n\n        for (let line of lines) {\n            if (line.includes(\"pong from\")) {\n                heartbeat.status = UP;\n                let time = line.split(\" in \")[1].split(\" \")[0];\n                heartbeat.ping = parseInt(time);","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/tailscale-ping.js#L22-L58","documentation":"Thrown by runTailscalePing() when the spawn resolved with neither a stderr error (code 0 or empty stderr) nor any stdout. The command produced no parseable output at all, so there is nothing to feed to parseTailscaleOutput().","triggerScenarios":"Produced when 'tailscale ping' exits successfully (code 0) but writes nothing to stdout, or when stdout is empty/whitespace-only. Can happen with abnormal daemon states, SIGPIPE, or a successful exit before any line is flushed.","commonSituations":"Daemon in an inconsistent state returning immediately; very short timeout (interval * 0.8) cutting the process off before output flushes; tailscale version that writes everything to stderr with code 0; a wrapper/alias swallowing stdout in the deployment.","solutions":["Run the same 'tailscale ping --c 1 <hostname>' command manually and confirm it actually prints to stdout.","Check the monitor interval — a very small interval yields a tiny timeout; raise it so the command has time to emit output.","Restart tailscaled if it is in an odd state producing no output.","Inspect whether a shell alias or container entrypoint is redirecting stdout."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function hasStdout(res) { return !!res?.stdout && res.stdout.toString().trim().length > 0; }","typeGuard":"function hasStdout(res) { return !!res?.stdout && res.stdout.toString().trim().length > 0; }","tryCatchPattern":"if (!hasStdout(res)) { heartbeat.status = DOWN; heartbeat.msg = \"No output from Tailscale ping\"; return; }","preventionTips":["Set a monitor interval large enough to let tailscale ping emit output.","Confirm the daemon is healthy and produces stdout when run manually.","Avoid wrappers that redirect stdout."],"tags":["tailscale","spawn","stdout","vpn"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}