{"record":{"id":"55aafdaefb32d586","repo":"BerriAI/litellm","slug":"focus-s3-bucket-name-must-be-provided-for-s3-expor","errorCode":null,"errorMessage":"FOCUS_S3_BUCKET_NAME must be provided for S3 exports","messagePattern":"FOCUS_S3_BUCKET_NAME must be provided for S3 exports","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/factory.py","lineNumber":54,"sourceCode":"        raise NotImplementedError(f\"Provider '{provider}' not supported for Focus export\")\n\n    @staticmethod\n    def _resolve_config(\n        *,\n        provider: str,\n        overrides: dict[str, Any],\n    ) -> dict[str, Any]:\n        if provider == \"s3\":\n            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_S3_BUCKET_NAME\"),\n                \"region_name\": overrides.get(\"region_name\") or os.getenv(\"FOCUS_S3_REGION_NAME\"),\n                \"endpoint_url\": overrides.get(\"endpoint_url\") or os.getenv(\"FOCUS_S3_ENDPOINT_URL\"),\n                \"aws_access_key_id\": overrides.get(\"aws_access_key_id\") or os.getenv(\"FOCUS_S3_ACCESS_KEY\"),\n                \"aws_secret_access_key\": overrides.get(\"aws_secret_access_key\") or os.getenv(\"FOCUS_S3_SECRET_KEY\"),\n                \"aws_session_token\": overrides.get(\"aws_session_token\") or os.getenv(\"FOCUS_S3_SESSION_TOKEN\"),\n            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_S3_BUCKET_NAME must be provided for S3 exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"vantage\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"VANTAGE_API_KEY\"),\n                \"integration_token\": overrides.get(\"integration_token\") or os.getenv(\"VANTAGE_INTEGRATION_TOKEN\"),\n                \"base_url\": overrides.get(\"base_url\") or os.getenv(\"VANTAGE_BASE_URL\", \"https://api.vantage.sh\"),\n            }\n            if not resolved.get(\"api_key\"):\n                raise ValueError(\"VANTAGE_API_KEY must be provided for Vantage exports\")\n            if not resolved.get(\"integration_token\"):\n                raise ValueError(\"VANTAGE_INTEGRATION_TOKEN must be provided for Vantage exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"gcs\":\n            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_GCS_BUCKET_NAME\"),\n                \"service_account_json\": overrides.get(\"service_account_json\")\n                or os.getenv(\"FOCUS_GCS_PATH_SERVICE_ACCOUNT\"),\n            }","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/focus/destinations/factory.py#L36-L72","documentation":"The Focus export destination factory resolves S3 settings from the destination_config overrides first, then from environment variables. When building an 's3' provider config it requires a bucket name; if neither overrides['bucket_name'] nor the FOCUS_S3_BUCKET_NAME env var is set, it raises this ValueError. All other S3 keys (region, endpoint, keys, session token) are optional and filtered out when None.","triggerScenarios":"Creating a Focus export with provider=\"s3\" while passing no bucket_name in the destination config dict and having no FOCUS_S3_BUCKET_NAME exported in the process environment (or an empty-string value, since the check is falsy-based).","commonSituations":"Running the LiteLLM proxy in a container/k8s where the FOCUS_S3_BUCKET_NAME secret was not mounted; typos in the env var name; relying on AWS_PROFILE/instance roles and assuming a bucket default exists (there is none); passing bucket_name under a different key such as 'bucket'.","solutions":["Set the env var: export FOCUS_S3_BUCKET_NAME=my-focus-bucket (or add it to the proxy's environment/.env).","Or pass bucket_name explicitly in the destination config: {\"provider\": \"s3\", \"bucket_name\": \"my-focus-bucket\"}.","Verify with a pre-flight check that os.getenv('FOCUS_S3_BUCKET_NAME') is non-empty before creating the export.","If using a different object-store provider name (e.g. custom endpoint), confirm 's3' is still the right provider string and the bucket env var matches the deployment environment."],"exampleFix":"# before\nconfig = focus_destination_config(provider=\"s3\", overrides={})\n\n# after\nexport FOCUS_S3_BUCKET_NAME=focus-exports  # shell\n# or\nconfig = focus_destination_config(provider=\"s3\", overrides={\"bucket_name\": \"focus-exports\"})","handlingStrategy":"validation","validationCode":"import os\n\nbucket = overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_S3_BUCKET_NAME\")\nif not bucket:\n    raise SystemExit(\"Set FOCUS_S3_BUCKET_NAME or pass bucket_name before creating the S3 Focus export\")","typeGuard":null,"tryCatchPattern":"try:\n    cfg = focus_destination_config(provider=\"s3\", overrides=overrides)\nexcept ValueError as e:\n    if \"FOCUS_S3_BUCKET_NAME\" in str(e):\n        log_config_error(\"s3\", missing=[\"bucket_name\"])\n    raise","preventionTips":["Keep a startup pre-flight that asserts all required env vars per enabled export provider are non-empty strings.","Fail deployment (not delivery time) on missing export config so misconfigurations surface in CI."],"tags":["focus","s3","configuration","env-var","validation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}