{"record":{"id":"536a59e73c66a8e4","repo":"weaviate/weaviate","slug":"connection-to-aws-sagemaker-failed-with-status-v","errorCode":null,"errorMessage":"connection to AWS Sagemaker failed with status: %v error: %s","messagePattern":"connection to AWS Sagemaker failed with status: (.+?) error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/generative-aws/clients/aws.go","lineNumber":514,"sourceCode":"\n\tif len(resBody.Results) > 0 && len(resBody.Results[0].CompletionReason) > 0 {\n\t\tcontent = resBody.Results[0].OutputText\n\t} else if len(resBody.Generations) > 0 {\n\t\tcontent = resBody.Generations[0].Text\n\t}\n\n\treturn content, nil\n}\n\nfunc (v *awsClient) parseSagemakerResponse(bodyBytes []byte, res *http.Response) (*modulecapabilities.GenerateResponse, error) {\n\tvar resBody sagemakerGenerateResponse\n\tif err := json.Unmarshal(bodyBytes, &resBody); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse generative response (status %d): %w\", res.StatusCode, err)\n\t}\n\n\tif res.StatusCode != 200 || resBody.Message != nil {\n\t\tif resBody.Message != nil {\n\t\t\treturn nil, fmt.Errorf(\"connection to AWS Sagemaker failed with status: %v error: %s\",\n\t\t\t\tres.StatusCode, *resBody.Message)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"connection to AWS Sagemaker failed with status: %d\", res.StatusCode)\n\t}\n\n\tif len(resBody.Generations) == 0 {\n\t\treturn nil, fmt.Errorf(\"received empty response from AWS Sagemaker\")\n\t}\n\n\tif len(resBody.Generations) > 0 && len(resBody.Generations[0].Id) > 0 {\n\t\tcontent := resBody.Generations[0].Text\n\t\tif content != \"\" {\n\t\t\treturn &modulecapabilities.GenerateResponse{\n\t\t\t\tResult: &content,\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn &modulecapabilities.GenerateResponse{","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/generative-aws/clients/aws.go#L496-L532","documentation":"The SageMaker endpoint returned a non-200 status and the response body contained a Message field, i.e. SageMaker itself reported an error. Both the HTTP status and the provider's message are surfaced. This points at the endpoint configuration or the deployed model (bad invocation payload for that endpoint, endpoint in Failed/Updating state, auth) rather than at Weaviate.","triggerScenarios":"Thrown at modules/generative-aws/clients/aws.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the SageMaker message in the error — it typically names the exact problem with the deployed endpoint","Verify the endpoint name and region in the class configuration, and that the endpoint is InService","Ensure the request body matches the input schema the deployed SageMaker model expects (each custom model defines its own JSON contract)","Check IAM permissions for sagecharger:InvokeEndpoint on the endpoint"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}