{"record":{"id":"a550dda2addc1dd6","repo":"BerriAI/litellm","slug":"bedrock-event-stream-shape-could-not-be-loaded-fro-a550dd","errorCode":null,"errorMessage":"Bedrock event-stream shape could not be loaded from botocore. Ensure botocore is correctly installed.","messagePattern":"Bedrock event-stream shape could not be loaded from botocore\\. Ensure botocore is correctly installed\\.","errorType":"exception","errorClass":"BedrockError","httpStatus":500,"severity":"error","filePath":"litellm/llms/bedrock/common_utils.py","lineNumber":1288,"sourceCode":"                status_code = int(modeled_status)\n\n    return BedrockError(status_code=status_code, message=message)\n\n\nclass BedrockEventStreamDecoderBase:\n    \"\"\"\n    Base class for event stream decoding for Bedrock\n    \"\"\"\n\n    def __init__(self):\n        from botocore.parsers import EventStreamJSONParser\n\n        self.parser = EventStreamJSONParser()\n\n    def _parse_message_from_event(self, event) -> str | None:\n        response_stream_shape: Final = get_bedrock_response_stream_shape()\n        if response_stream_shape is None:\n            raise BedrockError(\n                status_code=500,\n                message=(\n                    \"Bedrock event-stream shape could not be loaded from botocore. \"\n                    \"Ensure botocore is correctly installed.\"\n                ),\n            )\n        response_dict: Final = event.to_response_dict()\n        parsed_response: Final = self.parser.parse(response_dict, response_stream_shape)\n\n        if response_dict[\"status_code\"] != 200:\n            raise build_bedrock_stream_error(response_dict, response_stream_shape)\n        if \"chunk\" in parsed_response:\n            chunk = parsed_response.get(\"chunk\")\n            if not chunk:\n                return None\n            return chunk.get(\"bytes\").decode()\n        else:\n            chunk = response_dict.get(\"body\")","sourceCodeStart":1270,"sourceCodeEnd":1306,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/common_utils.py#L1270-L1306","documentation":"Environment guard in BedrockEventStreamDecoderBase: get_bedrock_response_stream_shape() returned None, meaning the event-stream shape could not be loaded from botocore. The installed botocore is missing or broken, so streaming events cannot be parsed.","triggerScenarios":"Thrown at litellm/llms/bedrock/common_utils.py:1288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reinstall or upgrade botocore: pip install -U botocore.","Verify botocore is importable in the runtime environment.","Check for a broken/partial botocore installation."],"exampleFix":null,"handlingStrategy":"fallback","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"}