{"record":{"id":"b24793485106053f","repo":"BerriAI/litellm","slug":"s3-bucket-name-is-required-set-s3-bucket-name-p","errorCode":null,"errorMessage":"S3 bucket name is required. Set 's3_bucket_name' parameter or {bucket_env_var} env var","messagePattern":"S3 bucket name is required\\. Set 's3_bucket_name' parameter or (.+?) env var","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/common_utils.py","lineNumber":1567,"sourceCode":"        Args:\n            litellm_params: LiteLLM parameters\n            optional_params: Optional parameters\n            bucket_env_var: Environment variable name for bucket\n            key_prefix: Prefix for the S3 key\n\n        Returns:\n            Tuple of (bucket_name, object_key)\n        \"\"\"\n        import time\n\n        from litellm._uuid import uuid\n\n        # Get bucket name\n        bucket_name: Final = (\n            litellm_params.get(\"s3_bucket_name\") or optional_params.get(\"s3_bucket_name\") or os.getenv(bucket_env_var)\n        )\n        if not bucket_name:\n            raise ValueError(f\"S3 bucket name is required. Set 's3_bucket_name' parameter or {bucket_env_var} env var\")\n\n        # Generate unique object key\n        timestamp: Final = int(time.time())\n        unique_id: Final = str(uuid.uuid4())[:8]\n        object_key: Final = f\"{key_prefix}-{timestamp}-{unique_id}\"\n\n        return bucket_name, object_key\n\n    def get_error_class(self, error_message: str, status_code: int, headers: dict | httpx.Headers) -> BaseLLMException:\n        \"\"\"\n        Get Bedrock-specific error class.\n        \"\"\"\n        return BedrockError(status_code=status_code, message=error_message, headers=headers)\n","sourceCodeStart":1549,"sourceCodeEnd":1581,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/common_utils.py#L1549-L1581","documentation":"Raised when LiteLLM needs to stage data to S3 (e.g. Bedrock batch/file transformation) but no bucket is configured. The bucket is resolved from litellm_params['s3_bucket_name'], then optional_params['s3_bucket_name'], then the AWS_S3_BUCKET_NAME environment variable (name configurable); if all are empty it fails.","triggerScenarios":"Invoking Bedrock features that require S3 staging (batch jobs, file transformation for converse) without s3_bucket_name anywhere; setting the env var in a shell that did not restart the proxy; typo in the parameter key.","commonSituations":"Deploying LiteLLM proxy in Kubernetes with a missing/misspelled env secret, using a different env var name than the default AWS_S3_BUCKET_NAME, or passing the bucket under a config key LiteLLM does not read.","solutions":["Set s3_bucket_name in the request's litellm params or the model's config","Or export AWS_S3_BUCKET_NAME=<bucket> in the environment running LiteLLM and restart it","Verify the value reaches the process: print(os.getenv('AWS_S3_BUCKET_NAME')) inside the same runtime"],"exampleFix":"# before\nlitellm.completion(model='bedrock/...', ...)  # file transformation needs S3\n\n# after\nexport AWS_S3_BUCKET_NAME=my-bucket\n# or per-call:\nlitellm.completion(model='bedrock/...', extra_body={'s3_bucket_name': 'my-bucket'}, ...)","handlingStrategy":"validation","validationCode":"import os\n\ndef resolve_s3_bucket(litellm_params: dict | None = None) -> str:\n    bucket = (litellm_params or {}).get(\"s3_bucket_name\") or os.getenv(\"AWS_S3_BUCKET_NAME\")\n    if not bucket:\n        raise ValueError(\"S3 bucket name is required. Set 's3_bucket_name' parameter or AWS_S3_BUCKET_NAME env var\")\n    return bucket","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set AWS_S3_BUCKET_NAME in the deployment environment (secret/configmap) and restart","Include s3_bucket_name in model config so it fails fast at config load, not mid-request","Add a boot-time env lint that asserts required S3 vars for Bedrock file features"],"tags":["bedrock","s3","configuration","aws"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}