{"record":{"id":"b185baff2ed8d82e","repo":"windmill-labs/windmill","slug":"failed-to-fetch-foundation-models-for-aws-bedrock","errorCode":null,"errorMessage":"Failed to fetch foundation models for AWS Bedrock","messagePattern":"Failed to fetch foundation models for AWS Bedrock","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/lib.ts","lineNumber":198,"sourceCode":"\t\t\t'X-Resource-Path': resourcePath,\n\t\t\t'X-Provider': provider\n\t\t}\n\n\t\t// Fetch both foundation models and inference profiles\n\t\tconst [foundationModelsResp, inferenceProfilesResp] = await Promise.all([\n\t\t\tfetch(`${location.origin}${OpenAPI.BASE}/w/${workspace}/ai/proxy/foundation-models`, {\n\t\t\t\tsignal,\n\t\t\t\theaders\n\t\t\t}),\n\t\t\tfetch(`${location.origin}${OpenAPI.BASE}/w/${workspace}/ai/proxy/inference-profiles`, {\n\t\t\t\tsignal,\n\t\t\t\theaders\n\t\t\t})\n\t\t])\n\n\t\tif (!foundationModelsResp.ok) {\n\t\t\tconsole.error('Failed to fetch foundation models', foundationModelsResp)\n\t\t\tthrow new Error('Failed to fetch foundation models for AWS Bedrock')\n\t\t}\n\n\t\tconst foundationModelsData = (await readListing(foundationModelsResp, maxBytes)) as {\n\t\t\tmodelSummaries: Array<{\n\t\t\t\tmodelId: string\n\t\t\t\tmodelArn: string\n\t\t\t\tinputModalities: string[]\n\t\t\t\toutputModalities: string[]\n\t\t\t\tinferenceTypesSupported: string[]\n\t\t\t}>\n\t\t}\n\n\t\t// Inference profiles fetch might fail in some regions/accounts\n\t\tlet inferenceProfiles: Array<{\n\t\t\tinferenceProfileId: string\n\t\t\tmodels: Array<{ modelArn: string }>\n\t\t}> = []\n","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/lib.ts#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let models: string[]\ntry {\n  models = await fetchAvailableModels(res, ws, 'aws_bedrock', signal)\n} catch {\n  models = AI_PROVIDERS.aws_bedrock.defaultModels // static fallback list\n  showWarning('Bedrock model listing unavailable; showing defaults')\n}","preventionTips":["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"],"tags":["network","aws","bedrock","ai-providers","proxy"],"backgroundTag":"model-list-fetch-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}