crewAIInc/crewAI · error · ValueError

S3 bucket name not configured. Set CREWAI_BEDROCK_S3_BUCKET

Error message

S3 bucket name not configured. Set CREWAI_BEDROCK_S3_BUCKET environment variable or pass bucket_name parameter.

What it means

ValueError raised by the Bedrock uploader's bucket_name property: no S3 bucket was supplied via constructor argument and the CREWAI_BEDROCK_S3_BUCKET environment variable is unset/empty. Bedrock uploads stage files in S3, so the bucket is mandatory; any access to bucket_name (including during upload) raises immediately.

Source

Thrown at lib/crewai-files/src/crewai_files/uploaders/bedrock.py:148

            "CREWAI_BEDROCK_S3_BUCKET_OWNER"
        )
        self._prefix = prefix
        self._region = region or os.environ.get(
            "AWS_REGION", os.environ.get("AWS_DEFAULT_REGION")
        )
        self._client: Any = client
        self._async_client: Any = async_client

    @property
    def provider_name(self) -> str:
        """Return the provider name."""
        return "bedrock"

    @property
    def bucket_name(self) -> str:
        """Return the configured bucket name."""
        if not self._bucket_name:
            raise ValueError(
                "S3 bucket name not configured. Set CREWAI_BEDROCK_S3_BUCKET "
                "environment variable or pass bucket_name parameter."
            )
        return self._bucket_name

    @property
    def bucket_owner(self) -> str | None:
        """Return the configured bucket owner."""
        return self._bucket_owner

    def _get_client(self) -> Any:
        """Get or create the S3 client."""
        if self._client is None:
            try:
                import boto3

                self._client = boto3.client("s3", region_name=self._region)
            except ImportError as e:

View on GitHub (pinned to 754d7323be)

Solutions

  1. Pass bucket_name explicitly: BedrockFileUploader(bucket_name='my-bucket', region_name=...).
  2. Export CREWAI_BEDROCK_S3_BUCKET=my-bucket in the process environment (and load .env before constructing the uploader).
  3. Add a startup assertion: read uploader.bucket_name once during wiring so misconfiguration fails fast.

Example fix

# before
uploader = BedrockFileUploader(region_name='us-east-1')
uploader.upload(file)  # ValueError: S3 bucket name not configured

# after
uploader = BedrockFileUploader(
    bucket_name='my-bedrock-uploads',
    region_name='us-east-1',
)
uploader.upload(file)
Defensive patterns

Strategy: validation

Validate before calling

import os

bucket = os.environ.get("CREWAI_BEDROCK_S3_BUCKET")
if not bucket:
    raise RuntimeError("set CREWAI_BEDROCK_S3_BUCKET or pass bucket_name")
uploader = BedrockFileUploader(bucket_name=bucket, region_name=os.environ["AWS_REGION"])
_ = uploader.bucket_name  # fail fast if still unconfigured

Try / catch

try:
    uploader.upload(file)
except ValueError as e:
    if "S3 bucket" in str(e):
        raise RuntimeError("Bedrock uploads need a bucket; check env/constructor") from e
    raise

Prevention

When it happens

Trigger: Constructing BedrockFileUploader without bucket_name in an environment where CREWAI_BEDROCK_S3_BUCKET is not set, then calling upload/async_upload; or setting the variable in a shell but not in the process (systemd unit, container, cron) that runs the app.

Common situations: Env var configured locally but missing in Docker/CI/production; name typo in the variable; .env file not loaded before uploader construction; assuming Bedrock needs no bucket like OpenAI/Anthropic uploaders do.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/d5e586d599b003ea. Report an issue: GitHub.