{"record":{"id":"1ab9ff7c5e72b213","repo":"can1357/oh-my-pi","slug":"google-browser-search-failed-message","errorCode":null,"errorMessage":"Google browser search failed: ${message}","messagePattern":"Google browser search failed: (.+?)","errorType":"exception","errorClass":"SearchProviderError","httpStatus":503,"severity":"error","filePath":"packages/coding-agent/src/web/search/providers/google.ts","lineNumber":141,"sourceCode":"\ttry {\n\t\tpage = await browserFetch(url, {\n\t\t\tfetch: params.fetch,\n\t\t\tsignal,\n\t\t\ttimeoutMs: params.timeoutMs,\n\t\t\treferer: GOOGLE_HOME_URL,\n\t\t\tbrowser: {\n\t\t\t\thomeUrl: GOOGLE_HOME_URL,\n\t\t\t\tready: { selector: \"a h3\", timeoutMs: RESULT_RENDER_TIMEOUT_MS },\n\t\t\t\tshouldFallback: candidate => blockReason(candidate) !== undefined,\n\t\t\t},\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof SearchProviderError || params.signal?.aborted) throw error;\n\t\tif (signal.aborted) {\n\t\t\tthrow new SearchProviderError(\"google\", \"Google browser search timed out.\", 504);\n\t\t}\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new SearchProviderError(\"google\", `Google browser search failed: ${message}`, 503);\n\t}\n\n\tconst blocked = blockReason(page);\n\tif (blocked === \"traffic\") {\n\t\tthrow new SearchProviderError(\n\t\t\t\"google\",\n\t\t\t\"Google blocked the browser search with an automated-traffic challenge. Try another web search provider or retry later.\",\n\t\t\t429,\n\t\t);\n\t}\n\tif (page.status < 200 || page.status >= 300) {\n\t\tthrow new SearchProviderError(\"google\", `Google HTML error (${page.status})`, page.status);\n\t}\n\tif (blocked === \"javascript\") {\n\t\tthrow new SearchProviderError(\n\t\t\t\"google\",\n\t\t\t\"Google returned its JavaScript challenge instead of rendered search results.\",\n\t\t\t429,","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/web/search/providers/google.ts#L123-L159","documentation":"Thrown by callGoogleHtml when the browser fetch of Google Search fails with an unexpected error that is neither a SearchProviderError nor a caller abort and the timeout signal has not fired. The original error message is embedded and wrapped as status 503 (upstream failure).","triggerScenarios":"browserFetch throws during the fetch-first attempt or headless-browser fallback — e.g. browser launch failure, DNS/network errors, TLS errors, or a page-load crash — while neither params.signal nor the hard-timeout signal is aborted.","commonSituations":"Headless browser (Playwright/Chromium) not installed or failing to launch in CI/containers; corporate proxy blocking google.com; DNS failure; SSL inspection certificates breaking the fetch.","solutions":["Inspect the embedded `message` for the root cause (DNS, proxy, browser launch, TLS).","Install/verify the headless browser runtime used by browserFetch if the fetch-first path fell back.","Fix network/proxy settings so google.com is reachable from the host.","Configure a different search provider if scraping Google is blocked in your network environment."],"exampleFix":"# before: container without browser deps\n$ omp web-search --provider google \"q\"  # Google browser search failed: Failed to launch browser\n# after\n$ npx playwright install --with-deps chromium","handlingStrategy":"fallback","validationCode":"// check egress and browser availability before scraping\ndns.lookup('www.google.com', err => { if (err) console.error('google.com unreachable'); });","typeGuard":"function isGoogleTransportFailure(e: unknown): boolean {\n  return e instanceof SearchProviderError && e.provider === 'google' && e.statusCode === 503;\n}","tryCatchPattern":"try {\n  return await search({ provider: 'google', query });\n} catch (err) {\n  if (isGoogleTransportFailure(err)) return await search({ provider: 'jina', query });\n  throw err;\n}","preventionTips":["Install the headless browser runtime and its OS dependencies in containers.","Allow google.com egress through firewalls/proxies.","Handle corporate TLS inspection certs in the runtime trust store.","Always configure a secondary API-backed search provider."],"tags":["network","browser","dns","google","search-provider"],"backgroundTag":"fetch-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}