microsoft/aspire · error · InvalidOperationException
The Microsoft Foundry model catalog response included…
Error message
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)} What it means
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.
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.
Defensive patterns
Strategy: retry
Try / catch
try
{
await RunGenModelAsync();
}
catch (InvalidOperationException ex) when (ex.Message.Contains("included partial failure data in"))
{
// page-level partial data: retry the run; inspect listed fields if persistent
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The Foundry Local endpoint must be an absolute HTTP or…
- The Microsoft Foundry model catalog response did not…
- The Microsoft Foundry model catalog response included…
- The Microsoft Foundry model catalog returned the same…
- -32602
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/6f3b1f70b6eeda09.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Foundry/tools/GenModel.cs:1070
{
if (string.IsNullOrWhiteSpace(content))
{
return "<empty>";
}
var sanitized = content.ReplaceLineEndings(" ").Trim();
return sanitized.Length <= ResponseSnippetLength
? sanitized
: sanitized[..ResponseSnippetLength] + "...";
}
private static void ValidateSuccessfulCatalogResponse(ApiResponse apiResponse, string pageResponse)
{
var partialFailureFields = GetPartialFailureFields(apiResponse);
if (partialFailureFields.Count > 0)
{
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)}");
}
}
private static List<string> GetPartialFailureFields(ApiResponse apiResponse)
{
var partialFailureFields = new List<string>();
AddPopulatedJsonField(partialFailureFields, "regionalErrors", apiResponse.RegionalErrors);
AddPopulatedJsonField(partialFailureFields, "resourceSkipReasons", apiResponse.ResourceSkipReasons);
AddPopulatedJsonField(partialFailureFields, "shardErrors", apiResponse.ShardErrors);
if (apiResponse.NumberOfResourcesNotIncludedInSearch > 0)
{
partialFailureFields.Add("numberOfResourcesNotIncludedInSearch");
}
return partialFailureFields;
}View on GitHub (pinned to 25830f84bd)