{"record":{"id":"12c987693191dfd7","repo":"Mintplex-Labs/anything-llm","slug":"catalog-request-failed-with-status-response-stat","errorCode":null,"errorMessage":"Catalog request failed with status ${response.status}","messagePattern":"Catalog request failed with status (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/foundry/catalog.js","lineNumber":177,"sourceCode":"          filters: [\n            { field: \"type\", operator: \"eq\", values: [\"models\"] },\n            { field: \"kind\", operator: \"eq\", values: [\"Versioned\"] },\n            { field: \"labels\", operator: \"eq\", values: [\"latest\"] },\n            {\n              field: \"properties/variantInfo/variantMetadata/executionProvider\",\n              operator: \"eq\",\n              values: this.EXECUTION_PROVIDERS,\n            },\n          ],\n          pageSize: this.PAGE_SIZE,\n          skip: null,\n          continuationToken,\n        },\n      }),\n    });\n\n    if (!response.ok)\n      throw new Error(`Catalog request failed with status ${response.status}`);\n    const body = await response.json();\n    const page = body?.indexEntitiesResponse ?? {};\n    return {\n      value: Array.isArray(page.value) ? page.value : [],\n      continuationToken: page.continuationToken ?? null,\n    };\n  }\n\n  /**\n   * @typedef {Object} CatalogVariant\n   * @property {string} name - Matches the id the daemon reports, eg `qwen3-0.6b-generic-gpu`.\n   * @property {'CPU'|'GPU'|'NPU'} deviceType\n   * @property {string|null} executionProvider\n   * @property {number} sizeMb\n   *\n   * @typedef {Object} CatalogModel\n   * @property {string} alias\n   * @property {string} task","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/AiProviders/foundry/catalog.js#L159-L195","documentation":"Thrown by the Foundry catalog fetcher when the POST to the Azure ML model registry catalog endpoint returns a non-2xx HTTP status. This endpoint is unauthenticated (gated only on User-Agent) and paginates available on-device Foundry models. A failure here prevents the catalog from being populated, blocking model discovery for the Foundry/LocalAI provider. The HTTP status code is embedded in the message.","triggerScenarios":"The Azure ML registry endpoint is temporarily unavailable (502/503); the request times out (AbortSignal.timeout fires, though that throws a different AbortError); the registry API changed its URL or contract (404/400); a corporate proxy blocks or modifies the request; Azure returns 429 for excessive catalog polling.","commonSituations":"Air-gapped or proxied environments where the Azure registry is unreachable; the User-Agent header 'AzureAiStudio' being stripped by a middleware; Azure transient outages; the CATALOG_URL constant pointing to a deprecated endpoint after an Azure backend migration.","solutions":["Check the embedded HTTP status code in the error message to classify the failure (4xx = client/config, 5xx = Azure-side).","Verify network connectivity to the Azure ML registry endpoint from the host.","If behind a proxy, ensure it allows the POST with the 'AzureAiStudio' User-Agent header.","For 429, reduce catalog refresh frequency and retry with backoff.","If the endpoint URL changed, update the CATALOG_URL constant to the current Azure registry endpoint."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-check reachability of the Azure ML registry catalog before paginating\nconst probe = await fetch(Catalog.CATALOG_URL, {\n  method: 'POST',\n  headers: { 'User-Agent': 'AzureAiStudio', 'Content-Type': 'application/json' },\n  signal: AbortSignal.timeout(5000),\n  body: JSON.stringify({ resourceIds: [{ resourceId: 'azureml', entityContainerType: 'Registry' }], indexEntitiesRequest: { filters: [], pageSize: 1, skip: null, continuationToken: null } }),\n}).catch(() => null);\nif (!probe || !probe.ok) throw new Error('Azure ML catalog endpoint is unreachable');","typeGuard":null,"tryCatchPattern":"for (let attempt = 1; attempt <= 3; attempt++) {\n  try {\n    return await Catalog.#fetchPage(continuationToken);\n  } catch (e) {\n    if (/Catalog request failed with status 5\\d{2}/.test(e.message) || /status 429/.test(e.message)) {\n      await sleep(1000 * attempt);\n      continue;\n    }\n    throw e;\n  }\n}","preventionTips":["Treat catalog fetch as retryable for 5xx and 429 responses with exponential backoff.","Cache the catalog result locally so transient Azure outages do not block model discovery.","Ensure the host can reach the Azure ML registry endpoint and that proxies preserve the 'AzureAiStudio' User-Agent header."],"tags":["foundry","catalog","http-status","network","azure","model-discovery"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}