{"record":{"id":"1e5c073aa1e69a1f","repo":"janhq/jan","slug":"failed-to-fetch-supported-backends-error-instan","errorCode":null,"errorMessage":"Failed to fetch supported backends: ${error instanceof Error ? error.message : error}","messagePattern":"Failed to fetch supported backends: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":1438,"sourceCode":"\n    this.isConfiguringBackends = true\n\n    try {\n      let version_backends: { version: string; backend: string }[] = []\n\n      try {\n        version_backends = await listSupportedBackends(\n          this.config.check_for_updates !== false\n        )\n        if (version_backends.length === 0) {\n          throw new Error(\n            'No supported backend binaries found for this system. Backend selection and auto-update will be unavailable.'\n          )\n        } else {\n          version_backends.sort((a, b) => b.version.localeCompare(a.version))\n        }\n      } catch (error) {\n        throw new Error(\n          `Failed to fetch supported backends: ${\n            error instanceof Error ? error.message : error\n          }`\n        )\n      }\n\n      // Get stored backend preference\n      const storedBackendType = await this.getStoredBackendType()\n      let bestAvailableBackendString = ''\n\n      // \"Recommended\" is computed against upstream releases only — a\n      // user-side-loaded backend (Install from File) must not bias the\n      // suggestion. If we have no remote data (check_for_updates off or\n      // offline), there is no honest recommendation to surface.\n      const remoteOnly =\n        this.config.check_for_updates !== false\n          ? await fetchRemoteBackends()\n          : []","sourceCodeStart":1420,"sourceCodeEnd":1456,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/llamacpp-extension/src/index.ts#L1420-L1456","documentation":"Wrapping error thrown when listSupportedBackends itself throws — the inner error (network failure, parse failure, API error) is caught and re-thrown with a 'Failed to fetch supported backends' prefix and the original message. This is distinct from error 5 which fires when the call succeeds but returns an empty list.","triggerScenarios":"listSupportedBackends throws: GitHub API rate limit (403), network timeout/DNS failure, malformed JSON in the fetched manifest, CDN returning an error page, or an internal assertion in the manifest parser.","commonSituations":"GitHub unauthenticated API rate limit in CI; corporate firewall blocking api.github.com or the CDN; CDN outage during a release window; proxy returning an HTML error page that fails JSON parsing.","solutions":["Retry after confirming network connectivity — transient rate limits and CDN hiccups are the most common cause.","Set a GitHub API token in the environment to raise the rate-limit ceiling if running in CI.","Switch the configured source between 'github' and 'cdn' to bypass a failing endpoint.","Pre-cache backend manifests locally if the environment is offline or behind a strict firewall."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function fetchBackendsWithRetry(maxAttempts = 3): Promise<typeof backends> {\n  for (let i = 0; i < maxAttempts; i++) {\n    try {\n      return await listSupportedBackends(true)\n    } catch (e) {\n      if (i === maxAttempts - 1) throw e\n      await new Promise(r => setTimeout(r, 1000 * (i + 1)))\n    }\n  }\n  throw new Error('unreachable')\n}","preventionTips":["Set a GITHUB_TOKEN in CI to avoid unauthenticated rate limits.","Provide a CDN fallback source in environments where GitHub is unreliable.","Cache the manifest response to survive transient outages."],"tags":["network","backend","rate-limit","api","typescript","retryable"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}