{"record":{"id":"665a177bb3eb7a5a","repo":"BerriAI/litellm","slug":"sync-response-text","errorCode":null,"errorMessage":"{sync_response.text}","messagePattern":"\\{sync_response\\.text\\}","errorType":"http","errorClass":"SagemakerError","httpStatus":null,"severity":"error","filePath":"litellm/llms/sagemaker/completion/handler.py","lineNumber":295,"sourceCode":"                api_key=\"\",\n                additional_args={\n                    \"complete_input_dict\": _data,\n                    \"api_base\": prepared_request.url,\n                    \"headers\": prepared_request.headers,\n                },\n            )\n\n            # make sync httpx post request here\n            try:\n                sync_response: Final = sync_handler.post(\n                    url=prepared_request.url,\n                    headers=prepared_request.headers,\n                    data=prepared_request.body,\n                    timeout=timeout,\n                )\n\n                if sync_response.status_code != 200:\n                    raise SagemakerError(\n                        status_code=sync_response.status_code,\n                        message=sync_response.text,\n                    )\n            except Exception as e:\n                ## LOGGING\n                logging_obj.post_call(\n                    input=[],\n                    api_key=\"\",\n                    original_response=str(e),\n                    additional_args={\"complete_input_dict\": _data},\n                )\n                raise e\n        except Exception as e:\n            verbose_logger.error(\"Sagemaker error %s\", str(e))\n            status_code: Final = getattr(e, \"response\", {}).get(\"ResponseMetadata\", {}).get(\"HTTPStatusCode\", 500)\n            error_message = getattr(e, \"response\", {}).get(\"Error\", {}).get(\"Message\", str(e))\n            if \"Inference Component Name header is required\" in error_message:\n                error_message += \"\\n pass in via `litellm.completion(..., model_id={InferenceComponentName})`\"","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sagemaker/completion/handler.py#L277-L313","documentation":"The synchronous SageMaker completion HTTP call returned a non-200 status; the handler raises SagemakerError carrying the raw response body so callers see the underlying endpoint error instead of a bare httpx status.","triggerScenarios":"Triggered when the synchronous SageMaker completion call returns an HTTP error; sync_response.text is surfaced.","commonSituations":"See trigger scenarios.","solutions":["Inspect sync_response.text for the endpoint's error message.","Verify the SageMaker endpoint is InService and the input schema matches."],"exampleFix":"# log the response body from the raised error.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}