windmill-labs/windmill · error
Failed to fetch foundation models for AWS Bedrock
Error message
Failed to fetch foundation models for AWS Bedrock
What it means
In fetchAvailableModels, the AWS Bedrock branch fetches the Bedrock foundation-models listing through Windmill's AI proxy; if the response is not ok the function logs the raw response and throws this generic Error. The proxy call itself depends on the Bedrock resource credentials being valid and the backend having network access to AWS.
Source
Thrown at frontend/src/lib/components/copilot/lib.ts:198
'X-Resource-Path': resourcePath,
'X-Provider': provider
}
// Fetch both foundation models and inference profiles
const [foundationModelsResp, inferenceProfilesResp] = await Promise.all([
fetch(`${location.origin}${OpenAPI.BASE}/w/${workspace}/ai/proxy/foundation-models`, {
signal,
headers
}),
fetch(`${location.origin}${OpenAPI.BASE}/w/${workspace}/ai/proxy/inference-profiles`, {
signal,
headers
})
])
if (!foundationModelsResp.ok) {
console.error('Failed to fetch foundation models', foundationModelsResp)
throw new Error('Failed to fetch foundation models for AWS Bedrock')
}
const foundationModelsData = (await readListing(foundationModelsResp, maxBytes)) as {
modelSummaries: Array<{
modelId: string
modelArn: string
inputModalities: string[]
outputModalities: string[]
inferenceTypesSupported: string[]
}>
}
// Inference profiles fetch might fail in some regions/accounts
let inferenceProfiles: Array<{
inferenceProfileId: string
models: Array<{ modelArn: string }>
}> = []
View on GitHub (pinned to e474e8803c)
Solutions
- Check the browser console/network tab for the proxy response status and error body
- Verify the AWS Bedrock resource (keys, region) is valid — test it in the resource editor
- Ensure the AWS IAM identity has bedrock:ListFoundationModels and Bedrock is enabled in that region
- Retry; if the backend cannot reach AWS, fix network/egress on the Windmill server
Defensive patterns
Strategy: fallback
Try / catch
let models: string[]
try {
models = await fetchAvailableModels(res, ws, 'aws_bedrock', signal)
} catch {
models = AI_PROVIDERS.aws_bedrock.defaultModels // static fallback list
showWarning('Bedrock model listing unavailable; showing defaults')
} Prevention
- Validate the AWS resource (keys + region) in the resource editor before use
- Grant bedrock:ListFoundationModels to the IAM identity
- Confirm Bedrock is enabled in the configured region
- Handle the inference-profiles failure separately — it is already non-fatal
When it happens
Trigger: GET /w/<workspace>/ai/proxy/foundation-models returns non-ok: invalid/expired AWS credentials in the Bedrock resource, wrong region, missing bedrock:ListFoundationModels permission, or no Bedrock access in the account.
Common situations: AWS keys rotated/expired; resource configured with a region where the account has no Bedrock; IAM policy lacking ListFoundationModels; corporate proxy blocking AWS endpoints; misconfigured resource path header.
Related errors
- Failed to fetch models for provider ${provider}
- HTTP error: ${response.status}
- Bad Gateway
- Bad Gateway
- error writing file to {path}: {e:#}
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/b185baff2ed8d82e.
Report an issue: GitHub.