{"record":{"id":"1762fc9daec9bdf5","repo":"BerriAI/litellm","slug":"received-streaming-error-e","errorCode":null,"errorMessage":"Received streaming error - {e}","messagePattern":"Received streaming error - (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/chat/invoke_handler.py","lineNumber":591,"sourceCode":"                        delta=Delta(\n                            content=text,\n                            role=\"assistant\",\n                            tool_calls=[tool_use] if tool_use else None,\n                            provider_specific_fields=(provider_specific_fields if provider_specific_fields else None),\n                            thinking_blocks=thinking_blocks,\n                            reasoning_content=reasoning_content,\n                        ),\n                    )\n                ],\n                id=self.response_id,\n                model=self.model,\n                usage=usage,\n                provider_specific_fields=model_response_provider_specific_fields,\n            )\n\n            return response\n        except Exception as e:\n            raise Exception(f\"Received streaming error - {e}\")\n\n    def _chunk_parser(self, chunk_data: dict) -> GChunk | ModelResponseStream | dict:\n        text = \"\"\n        is_finished = False\n        finish_reason = \"\"\n        if \"outputText\" in chunk_data:\n            text = chunk_data[\"outputText\"]\n        # ai21 mapping\n        elif \"ai21\" in self.model:  # fake ai21 streaming\n            text = chunk_data[\"completions\"][0][\"data\"][\"text\"]\n            is_finished = True\n            finish_reason = \"stop\"\n        ######## /bedrock/converse mappings ###############\n        elif (\n            \"contentBlockIndex\" in chunk_data\n            or \"stopReason\" in chunk_data\n            or \"metrics\" in chunk_data\n            or \"trace\" in chunk_data","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/chat/invoke_handler.py#L573-L609","documentation":"Stream error surfaced while parsing Bedrock streaming chunks in the model response iterator: the provider emitted an error event/exception mid-stream, and the chunk parser wraps it so the partially assembled stream terminates with the provider's error detail.","triggerScenarios":"Thrown at litellm/llms/bedrock/chat/invoke_handler.py:591 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the streamed error event for the underlying Bedrock error and fix its cause.","Retry the request; transient stream errors often succeed on retry.","Reduce request size or check model access if the error persists."],"exampleFix":null,"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"}