BerriAI/litellm · error · ValueError
S3 bucket_name is required. Set 's3_bucket_name' in proxy co
Error message
S3 bucket_name is required. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval.
What it means
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.
Source
Thrown at litellm/llms/bedrock/files/transformation.py:194
def get_configured_s3_bucket_name(litellm_params: Mapping[str, object]) -> str:
"""
Resolve the server-configured S3 bucket for Bedrock file operations.
Only trusts the immutable server-side credential snapshot or the
environment; never a request-supplied param, since the bucket is what
`validate_managed_cloud_file_id` checks file ids against.
"""
trusted_model_credentials: Final = litellm_params.get("_litellm_internal_model_credentials")
bucket_name: str | None = None
if isinstance(trusted_model_credentials, MappingProxyType):
snapshot: Final[dict[str, object]] = {}
snapshot.update(trusted_model_credentials) # any-ok: untyped snapshot
bucket_name = _TrustedS3ModelCredentials.model_validate(snapshot).s3_bucket_name
bucket_name = bucket_name or os.getenv("AWS_S3_BUCKET_NAME")
if not bucket_name:
raise ValueError(
"S3 bucket_name is required. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval."
)
return bucket_name
class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
"""
Config for Bedrock Files - handles S3 uploads for Bedrock batch processing
"""
def __init__(self):
self.jsonl_transformation = BedrockJsonlFilesTransformation()
super().__init__()
@property
def custom_llm_provider(self) -> LlmProviders:
return LlmProviders.BEDROCK
View on GitHub (pinned to 6c2dcb801b)
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.
Example fix
# before: ValueError: S3 bucket_name is required ... # after (docker): # docker run -e AWS_S3_BUCKET_NAME=my-bucket ... litellm/proxy # or litellm_config.yaml: # litellm_settings: # s3_bucket_name: my-bucket
Defensive patterns
Strategy: validation
Validate before calling
import os
assert os.getenv("AWS_S3_BUCKET_NAME") or config.get("s3_bucket_name"), "configure S3 bucket before enabling Bedrock file content" Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- S3 bucket_name is required. Set 's3_bucket_name' in litellm_
- S3 bucket name is required. Set 's3_bucket_name' parameter o
- file_id is required in file_content_request
- Failed to download file from S3: {s3_uri}. Error: {e}
- raw_response.text
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/90179efc7c8e554b.
Report an issue: GitHub.