{"record":{"id":"f454dbf42b828fee","repo":"angular/angular-cli","slug":"error-searching-fallback-angular-v-finalsearchedv","errorCode":null,"errorMessage":"Error searching fallback Angular v${finalSearchedVersion} documentation: ${error}","messagePattern":"Error searching fallback Angular v(.+?) documentation: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/commands/mcp/tools/doc-search.ts","lineNumber":175,"sourceCode":"    let allHits: Record<string, unknown>[] | undefined;\n    try {\n      allHits = await performSearch(query, finalSearchedVersion);\n    } catch (error) {\n      logger.warn(`Error searching Angular v${finalSearchedVersion} documentation: ${error}`);\n    }\n\n    // If the initial search for a newer-than-stable version returns no results, it may be because\n    // the index for that version doesn't exist yet. In this case, fall back to the latest known\n    // stable version.\n    if ((!allHits || allHits.length === 0) && finalSearchedVersion > LATEST_KNOWN_DOCS_VERSION) {\n      logger.warn(\n        `Documentation index for v${finalSearchedVersion} not found or empty. Falling back to v${LATEST_KNOWN_DOCS_VERSION}.`,\n      );\n      finalSearchedVersion = LATEST_KNOWN_DOCS_VERSION;\n      try {\n        allHits = await performSearch(query, finalSearchedVersion);\n      } catch (error) {\n        logger.warn(\n          `Error searching fallback Angular v${finalSearchedVersion} documentation: ${error}`,\n        );\n      }\n    }\n\n    if (!allHits?.length) {\n      return {\n        content: [\n          {\n            type: 'text' as const,\n            text: `No results found for query \"${query}\" in Angular v${finalSearchedVersion} documentation.`,\n          },\n        ],\n        structuredContent: { results: [], searchedVersion: finalSearchedVersion },\n      };\n    }\n\n    const structuredResults = [];","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/tools/doc-search.ts#L157-L193","documentation":"After falling back to the stable docs version, the retry `performSearch` call itself threw. The tool logs this warning and will ultimately return the raw search titles without fetched content (or empty results).","triggerScenarios":"The fallback `performSearch(query, LATEST_KNOWN_DOCS_VERSION)` throws — network failure, HTTP error, or unparseable index response — after the primary search already failed or returned empty.","commonSituations":"Complete loss of internet access; DNS failure; blocked CDN endpoints in restricted corporate environments; transient docs service outage.","solutions":["Restore network access or configure proxy environment variables (HTTPS_PROXY).","Retry the MCP doc search later.","Check status of angular.dev/ai.dev endpoints from the same machine (curl).","Use local Angular documentation instead of the MCP search tool."],"exampleFix":"// before (blocked)\nexport HTTPS_PROXY=  # unset/broken proxy\n// after\nexport HTTPS_PROXY=http://proxy.corp.example:8080","handlingStrategy":"retry","validationCode":"const res = await fetch(url, { method: 'HEAD' }); if (!res.ok) throw new Error(`docs unreachable: ${res.status}`);","typeGuard":"function isAbortError(e: unknown): e is DOMException { return e instanceof DOMException && e.name === 'AbortError'; }","tryCatchPattern":"for (let i = 0; i < 3; i++) { try { return await performSearch(q, v); } catch (e) { if (i === 2) logger.warn(`fallback search failed: ${e}`); } }","preventionTips":["Ensure reliable network access or configure HTTPS_PROXY.","Check angular.dev availability with curl before debugging the tool.","Space out heavy doc searches to avoid rate limits."],"tags":["network","documentation-search","fallback","mcp"],"backgroundTag":"docs-fetch-failed","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}