{"record":{"id":"cc4dd3036b762780","repo":"BerriAI/litellm","slug":"str-response-read","errorCode":null,"errorMessage":"str(response.read())","messagePattern":"str\\(response\\.read\\(\\)\\)","errorType":"exception","errorClass":"VertexAgentEngineError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/agent_engine/transformation.py","lineNumber":391,"sourceCode":"        from litellm.utils import CustomStreamWrapper\n\n        if client is None or not isinstance(client, HTTPHandler):\n            client = _get_httpx_client(params={})\n\n        # Avoid logging sensitive api_base directly\n        verbose_logger.debug(\"Making sync streaming request to Vertex AI endpoint.\")\n\n        # Make streaming request\n        response: Final = client.post(\n            api_base,\n            headers=headers,\n            data=json.dumps(data),\n            stream=True,\n            logging_obj=logging_obj,\n        )\n\n        if response.status_code != 200:\n            raise VertexAgentEngineError(status_code=response.status_code, message=str(response.read()))\n\n        # Create iterator for SSE stream\n        completion_stream: Final = self.get_streaming_response(model=model, raw_response=response)\n\n        streaming_response: Final = CustomStreamWrapper(\n            completion_stream=completion_stream,\n            model=model,\n            custom_llm_provider=custom_llm_provider,\n            logging_obj=logging_obj,\n        )\n\n        # LOGGING\n        logging_obj.post_call(\n            input=messages,\n            api_key=\"\",\n            original_response=\"first stream response received\",\n            additional_args={\"complete_input_dict\": data},\n        )","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/agent_engine/transformation.py#L373-L409","documentation":"Vertex Agent Engine sync streaming guard: the streaming POST returned a status other than 200, so VertexAIError is raised with the status code and the fully-read response body before the stream is consumed.","triggerScenarios":"Triggered when the Vertex Agent Engine sync response indicates an error; the response body is surfaced.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response content read from the stream for the error detail.","Verify Agent Engine endpoint configuration and credentials."],"exampleFix":"# print the raw 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-23T08:17:48.524Z"}