{"record":{"id":"6f3b1f70b6eeda09","repo":"microsoft/aspire","slug":"the-microsoft-foundry-model-catalog-response-included-6f3b1f","errorCode":null,"errorMessage":"The Microsoft Foundry model catalog response included partial failure data in {string.Join(\", \", partialFailureFields)}. Refusing to overwrite the generated model descriptors with a partial catalog. Response: {GetResponseSnippet(pageResponse)}","messagePattern":"The Microsoft Foundry model catalog response included partial failure data in (.+?)\\. Refusing to overwrite the generated model descriptors with a partial catalog\\. Response: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Foundry/tools/GenModel.cs","lineNumber":1070,"sourceCode":"    {\n        if (string.IsNullOrWhiteSpace(content))\n        {\n            return \"<empty>\";\n        }\n\n        var sanitized = content.ReplaceLineEndings(\" \").Trim();\n        return sanitized.Length <= ResponseSnippetLength\n            ? sanitized\n            : sanitized[..ResponseSnippetLength] + \"...\";\n    }\n\n    private static void ValidateSuccessfulCatalogResponse(ApiResponse apiResponse, string pageResponse)\n    {\n        var partialFailureFields = GetPartialFailureFields(apiResponse);\n\n        if (partialFailureFields.Count > 0)\n        {\n            throw new InvalidOperationException($\"The Microsoft Foundry model catalog response included partial failure data in {string.Join(\", \", partialFailureFields)}. Refusing to overwrite the generated model descriptors with a partial catalog. Response: {GetResponseSnippet(pageResponse)}\");\n        }\n    }\n\n    private static List<string> GetPartialFailureFields(ApiResponse apiResponse)\n    {\n        var partialFailureFields = new List<string>();\n\n        AddPopulatedJsonField(partialFailureFields, \"regionalErrors\", apiResponse.RegionalErrors);\n        AddPopulatedJsonField(partialFailureFields, \"resourceSkipReasons\", apiResponse.ResourceSkipReasons);\n        AddPopulatedJsonField(partialFailureFields, \"shardErrors\", apiResponse.ShardErrors);\n\n        if (apiResponse.NumberOfResourcesNotIncludedInSearch > 0)\n        {\n            partialFailureFields.Add(\"numberOfResourcesNotIncludedInSearch\");\n        }\n\n        return partialFailureFields;\n    }","sourceCodeStart":1052,"sourceCodeEnd":1088,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Foundry/tools/GenModel.cs#L1052-L1088","documentation":"ValidateSuccessfulCatalogResponse is called by GetAllModelsAsync on each catalog page after the value array is extracted. If GetPartialFailureFields finds any partial-failure indicators in the deserialized ApiResponse, it throws with the offending field names and a response snippet, preventing a partially loaded catalog from overwriting the generated descriptors.","triggerScenarios":"During pagination in GetAllModelsAsync, a successfully-deserialized page's ApiResponse contains partial-failure fields (e.g. per-field error/partial markers) — the page-level validation throw after GetModelsAsync returned content.","commonSituations":"Foundry serving pages with some model records missing due to backend issues; schema updates adding fields that GetPartialFailureFields misinterprets as partial-failure markers; intermittent regional degradation during the page walk.","solutions":["Re-run the tool — transient partial pages usually succeed on a later run.","Compare the listed partial-failure fields against the current API schema; update GetPartialFailureFields if the meaning of fields changed.","Check Foundry service health if partial data persists across runs.","If a specific page is consistently partial, capture the snippet and report/investigate the specific index range it covers."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await RunGenModelAsync();\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"included partial failure data in\"))\n{\n    // page-level partial data: retry the run; inspect listed fields if persistent\n}","preventionTips":["Re-run codegen on transient partial pages before investigating","Track Foundry schema updates that affect GetPartialFailureFields","Capture response snippets from failures to detect recurring patterns","Stagger large catalog runs to reduce partial-page likelihood"],"tags":["validation","partial-data","azure-foundry","pagination"],"backgroundTag":"upstream-api-error","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}