{"record":{"id":"4c01cc366b74e9c1","repo":"mastra-ai/mastra","slug":"timeout-resolving-websocket-url-from-versionurl","errorCode":null,"errorMessage":"Timeout resolving WebSocket URL from ${versionUrl} (10s)","messagePattern":"Timeout resolving WebSocket URL from (.+?) \\(10s\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"browser/firecrawl/src/resolve-cdp.ts","lineNumber":39,"sourceCode":"    try {\n      const response = await fetch(versionUrl, { signal: controller.signal });\n\n      if (!response.ok) {\n        throw new Error(\n          `Failed to fetch CDP version info from ${versionUrl}: ${response.status} ${response.statusText}`,\n        );\n      }\n\n      const data = (await response.json()) as { webSocketDebuggerUrl?: string };\n      if (!data.webSocketDebuggerUrl) {\n        throw new Error(`No webSocketDebuggerUrl found in CDP version response from ${versionUrl}`);\n      }\n\n      logger?.debug?.(`Resolved WebSocket URL: ${data.webSocketDebuggerUrl}`);\n      return data.webSocketDebuggerUrl;\n    } catch (error) {\n      if (error instanceof Error && error.name === 'AbortError') {\n        throw new Error(`Timeout resolving WebSocket URL from ${versionUrl} (10s)`);\n      }\n      throw error;\n    } finally {\n      clearTimeout(timeoutId);\n    }\n  }\n\n  return url;\n}\n","sourceCodeStart":21,"sourceCodeEnd":49,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/browser/firecrawl/src/resolve-cdp.ts#L21-L49","documentation":"resolveCdpWebSocketUrl enforces a 10-second timeout on the CDP version fetch using AbortController. When fetch aborts (AbortError), the library rethrows it as this clearer timeout error. It means the CDP endpoint did not respond within 10 seconds.","triggerScenarios":"Constructor or wsUrl call where the HTTP request to versionUrl hangs longer than 10 seconds — network black hole, unreachable host, TLS handshake stall, or overloaded remote browser service.","commonSituations":"Firewall/security group blocking the CDP port; DNS resolving but connection never completing; remote browser service outage; slow VPN or corporate proxy.","solutions":["Check network reachability of the versionUrl host/port (curl the URL)","Retry — transient latency or service slowness may resolve","Verify no firewall, VPN, or proxy is blocking the CDP endpoint","Check Firecrawl service status / recreate the browser session"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const ctrl = new AbortController();\nconst t = setTimeout(() => ctrl.abort(), 5000);\ntry { await fetch(versionUrl, { signal: ctrl.signal }); console.log('CDP reachable'); }\ncatch { console.error('CDP endpoint unreachable within 5s'); }\nfinally { clearTimeout(t); }","typeGuard":null,"tryCatchPattern":"try {\n  const browser = new FirecrawlBrowser(config);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('Timeout resolving WebSocket URL')) {\n    // bounded retry with backoff\n    await retryWithBackoff(() => new FirecrawlBrowser(config), 3);\n  } else throw e;\n}","preventionTips":["Pre-flight the versionUrl with curl to confirm network reachability","Check firewall/VPN/proxy rules for the CDP host and port","Set alerts on Firecrawl service status if running in production","Fail fast with a clear startup error rather than hanging"],"tags":["network","timeout","cdp","browser"],"backgroundTag":"connection-timeout","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}