BerriAI/litellm · error · BedrockError

Timeout error occurred.

Error message

Timeout error occurred.

What it means

Error "Timeout error occurred." thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/bedrock/chat/invoke_handler.py:233

            completion_stream = decoder.aiter_bytes(response.aiter_bytes(chunk_size=stream_chunk_size))
        else:
            decoder = AWSEventStreamDecoder(model=model, json_mode=json_mode)
            completion_stream = decoder.aiter_bytes(response.aiter_bytes(chunk_size=stream_chunk_size))

        # LOGGING
        logging_obj.post_call(
            input=messages,
            api_key="",
            original_response="first stream response received",
            additional_args={"complete_input_dict": data},
        )

        return completion_stream
    except httpx.HTTPStatusError as err:
        error_code: Final = err.response.status_code
        raise BedrockError(status_code=error_code, message=err.response.text)
    except httpx.TimeoutException:
        raise BedrockError(status_code=408, message="Timeout error occurred.")
    except Exception as e:
        raise BedrockError(status_code=500, message=str(e))


def make_sync_call(
    client: HTTPHandler | None,
    api_base: str,
    headers: dict,
    data: str,
    signed_json_body: bytes | None,
    model: str,
    messages: list,
    logging_obj: Logging,
    fake_stream: bool = False,
    json_mode: bool | None = False,
    bedrock_invoke_provider: litellm.BEDROCK_INVOKE_PROVIDERS_LITERAL | None = None,
    stream_chunk_size: int | None = None,
):

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Increase the timeout or check Bedrock Invoke latency/connectivity.

When it happens

Trigger: Thrown at litellm/llms/bedrock/chat/invoke_handler.py:233 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/e43f743c549f08e8. Report an issue: GitHub.