{"record":{"id":"e83df035f0352488","repo":"decolua/9router","slug":"tunnel-direct-url-not-reachable-yet-continuing","errorCode":null,"errorMessage":"[Tunnel] direct URL not reachable yet, continuing via publicUrl","messagePattern":"\\[Tunnel\\] direct URL not reachable yet, continuing via publicUrl","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/lib/tunnel/cloudflare/manager.js","lineNumber":95,"sourceCode":"      if (onUnexpectedExit) onUnexpectedExit();\n    });\n\n    const { tunnelUrl } = await spawnQuickTunnel(localPort, onUrlUpdate);\n    console.log(`[Tunnel] spawned: ${tunnelUrl}`);\n    throwIfCancelled(token);\n\n    const publicUrl = `https://r${shortId}.abc-tunnel.us`;\n    await registerTunnelUrl(shortId, tunnelUrl);\n    saveState({ shortId, tunnelUrl });\n    await updateSettings({ tunnelEnabled: true, tunnelUrl });\n    console.log(`[Tunnel] registered shortId=${shortId} publicUrl=${publicUrl}`);\n\n    // Verify publicUrl first (worker route is reliable; direct *.trycloudflare.com DNS may lag)\n    await waitForHealth(publicUrl, token);\n    console.log(\"[Tunnel] public URL healthy\");\n    // Direct tunnel probe is best-effort: DNS for *.trycloudflare.com can be slow/blocked\n    if (!(await probeUrlAlive(tunnelUrl))) {\n      console.warn(\"[Tunnel] direct URL not reachable yet, continuing via publicUrl\");\n    } else {\n      console.log(\"[Tunnel] direct URL healthy\");\n    }\n\n    console.log(\"[Tunnel] enable success\");\n    return { success: true, tunnelUrl, shortId, publicUrl };\n  } catch (e) {\n    // Suppress noise when spawn was deliberately killed (restart/disable superseded it)\n    if (!/cloudflared killed|tunnel cancelled/.test(e.message)) {\n      console.error(`[Tunnel] enable error: ${e.message}`);\n    }\n    throw e;\n  } finally {\n    svc.spawnInProgress = false;\n  }\n}\n\nexport async function disableTunnel() {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/src/lib/tunnel/cloudflare/manager.js#L77-L113","documentation":"After a quick tunnel is enabled, enableTunnel verifies the public worker URL first (reliable), then probes the direct *.trycloudflare.com URL best-effort. If the direct probe fails — because DNS propagation for the freshly minted trycloudflare hostname lags or is blocked — this warning is logged and enablement still succeeds, returning publicUrl as the working entry point.","triggerScenarios":"probeUrlAlive(tunnelUrl) returns false right after a new quick tunnel is created: fresh hostname DNS not propagated yet, local resolver cache, or network blocking trycloudflare.com while the worker route works.","commonSituations":"Corporate DNS filtering *.trycloudflare.com; first minutes after tunnel creation; VPN/proxy interference; clients configured to hit the direct URL seeing failures until DNS settles.","solutions":["Use the returned publicUrl (worker route) instead of the direct trycloudflare URL — it is verified healthy.","Wait 1–5 minutes for trycloudflare DNS propagation and re-probe the direct URL.","Switch the client environment's DNS (e.g. 1.1.1.1) if *.trycloudflare.com is blocked by the local resolver/firewall.","If the direct URL must work, restart tunnel enablement to mint a fresh hostname after fixing network egress."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// verify which URL is usable before pointing clients at it\nasync function pickUrl(publicUrl, directUrl) {\n  for (const url of [directUrl, publicUrl]) {\n    try { const r = await fetch(url + \"/health\"); if (r.ok) return url; } catch {}\n  }\n  return publicUrl;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use the returned publicUrl as the canonical entry point.","Allow a few minutes for trycloudflare DNS propagation before sharing the direct URL.","Whitelist *.trycloudflare.com in corporate DNS/proxies if the direct URL is needed.","Re-check direct reachability after network/VPN changes."],"tags":["tunnel","cloudflare","dns","health-check","network"],"backgroundTag":"dns-not-propagated","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}