{"record":{"id":"90179efc7c8e554b","repo":"BerriAI/litellm","slug":"s3-bucket-name-is-required-set-s3-bucket-name-i","errorCode":null,"errorMessage":"S3 bucket_name is required. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval.","messagePattern":"S3 bucket_name is required\\. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":194,"sourceCode":"\n\ndef get_configured_s3_bucket_name(litellm_params: Mapping[str, object]) -> str:\n    \"\"\"\n    Resolve the server-configured S3 bucket for Bedrock file operations.\n\n    Only trusts the immutable server-side credential snapshot or the\n    environment; never a request-supplied param, since the bucket is what\n    `validate_managed_cloud_file_id` checks file ids against.\n    \"\"\"\n    trusted_model_credentials: Final = litellm_params.get(\"_litellm_internal_model_credentials\")\n    bucket_name: str | None = None\n    if isinstance(trusted_model_credentials, MappingProxyType):\n        snapshot: Final[dict[str, object]] = {}\n        snapshot.update(trusted_model_credentials)  # any-ok: untyped snapshot\n        bucket_name = _TrustedS3ModelCredentials.model_validate(snapshot).s3_bucket_name\n    bucket_name = bucket_name or os.getenv(\"AWS_S3_BUCKET_NAME\")\n    if not bucket_name:\n        raise ValueError(\n            \"S3 bucket_name is required. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval.\"\n        )\n    return bucket_name\n\n\nclass BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):\n    \"\"\"\n    Config for Bedrock Files - handles S3 uploads for Bedrock batch processing\n    \"\"\"\n\n    def __init__(self):\n        self.jsonl_transformation = BedrockJsonlFilesTransformation()\n        super().__init__()\n\n    @property\n    def custom_llm_provider(self) -> LlmProviders:\n        return LlmProviders.BEDROCK\n","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/files/transformation.py#L176-L212","documentation":"get_configured_s3_bucket_name resolves the server-side bucket only from the immutable internal credential snapshot or the AWS_S3_BUCKET_NAME environment variable — deliberately never from request-supplied params. If neither source yields a bucket, retrieval of Bedrock file content cannot proceed and raises.","triggerScenarios":"Fetching file content when the proxy server was not configured with s3_bucket_name (general.yaml/proxy settings) and AWS_S3_BUCKET_NAME is not set in the server process environment.","commonSituations":"Deploying the proxy without the S3 settings used at file-upload time; env var set in the shell but not in the systemd/docker unit running the proxy; splitting upload and content services with different configs.","solutions":["Set s3_bucket_name in the proxy config yaml (per-model or general settings) used by the LiteLLM proxy.","Or export AWS_S3_BUCKET_NAME in the server process environment (docker env, k8s secret).","Restart the proxy after adding the setting and verify with a health/config dump."],"exampleFix":"# before: ValueError: S3 bucket_name is required ...\n\n# after (docker):\n# docker run -e AWS_S3_BUCKET_NAME=my-bucket ... litellm/proxy\n# or litellm_config.yaml:\n# litellm_settings:\n#   s3_bucket_name: my-bucket","handlingStrategy":"validation","validationCode":"import os\nassert os.getenv(\"AWS_S3_BUCKET_NAME\") or config.get(\"s3_bucket_name\"), \"configure S3 bucket before enabling Bedrock file content\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set AWS_S3_BUCKET_NAME in the deployment manifest (docker env / k8s secret), not just the dev shell.","Add a startup config assertion so the proxy fails fast at boot, not on first file request."],"tags":["bedrock","files","s3","configuration","proxy"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}