{"record":{"id":"ac06ee9de517b07e","repo":"BerriAI/litellm","slug":"focus-gcs-bucket-name-must-be-provided-for-gcs-exp","errorCode":null,"errorMessage":"FOCUS_GCS_BUCKET_NAME must be provided for GCS exports","messagePattern":"FOCUS_GCS_BUCKET_NAME must be provided for GCS exports","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/factory.py","lineNumber":74,"sourceCode":"        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            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_GCS_BUCKET_NAME must be provided for GCS exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"mavvrik\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"MAVVRIK_API_KEY\"),\n                \"api_endpoint\": overrides.get(\"api_endpoint\") or os.getenv(\"MAVVRIK_API_ENDPOINT\"),\n                \"connection_id\": overrides.get(\"connection_id\") or os.getenv(\"MAVVRIK_CONNECTION_ID\"),\n            }\n            return {k: v for k, v in resolved.items() if v is not None}\n        raise NotImplementedError(f\"Provider '{provider}' not supported for Focus export configuration\")\n","sourceCodeStart":56,"sourceCodeEnd":84,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/destinations/factory.py#L56-L84","documentation":"When building a GCS Focus destination, _resolve_config resolves bucket_name from config overrides then the FOCUS_GCS_BUCKET_NAME environment variable and raises ValueError if neither is set. The optional service account (service_account_json override or FOCUS_GCS_PATH_SERVICE_ACCOUNT env) is not required here — only the bucket is validated eagerly; credential problems surface later at upload time.","triggerScenarios":"FocusDestinationFactory.create(provider='gcs', ...) with no bucket_name in config and FOCUS_GCS_BUCKET_NAME unset; confusing FOCUS_GCS_PATH_SERVICE_ACCOUNT (credentials) with the bucket variable and setting only the former; env var missing in the deployed worker.","commonSituations":"GCP deployments where the bucket name lives in Terraform but was never exported as env; naming confusion between the S3-style FOCUS_S3_BUCKET_NAME and the GCS variable; local env set, container env not.","solutions":["Set FOCUS_GCS_BUCKET_NAME to the target bucket (no gs:// scheme needed)","Or pass bucket_name in the config dict to create()","Optionally set FOCUS_GCS_PATH_SERVICE_ACCOUNT for the service-account JSON when not using Application Default Credentials","Declare the env var in the container/service spec for the export job"],"exampleFix":"# before\nos.environ['FOCUS_GCS_PATH_SERVICE_ACCOUNT'] = '/secrets/gcp.json'  # credentials only\ndest = FocusDestinationFactory.create(provider='gcs', prefix='focus/')\n\n# after\nos.environ['FOCUS_GCS_BUCKET_NAME'] = 'my-focus-bucket'\nos.environ['FOCUS_GCS_PATH_SERVICE_ACCOUNT'] = '/secrets/gcp.json'\ndest = FocusDestinationFactory.create(provider='gcs', prefix='focus/')","handlingStrategy":"validation","validationCode":"import os\n\nbucket = config.get('bucket_name') or os.getenv('FOCUS_GCS_BUCKET_NAME')\nif not bucket:\n    raise ValueError('FOCUS_GCS_BUCKET_NAME (or config bucket_name) required for GCS Focus export')\ndest = FocusDestinationFactory.create(provider='gcs', prefix='focus/', config={'bucket_name': bucket})","typeGuard":null,"tryCatchPattern":"try:\n    dest = FocusDestinationFactory.create(provider='gcs', prefix='focus/', config=config)\nexcept ValueError as e:\n    if 'FOCUS_GCS_BUCKET_NAME' in str(e):\n        raise RuntimeError('GCS export not configured; set FOCUS_GCS_BUCKET_NAME') from e\n    raise","preventionTips":["Don't confuse FOCUS_GCS_BUCKET_NAME (destination) with FOCUS_GCS_PATH_SERVICE_ACCOUNT (credentials)","Set the bucket via config or env in the export worker's service definition","Verify Application Default Credentials or the service-account path separately — absence only fails at upload time"],"tags":["litellm","focus","gcs","export","missing-env-var","gcp"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}