{"record":{"id":"26078bb5b0c31cbc","repo":"BerriAI/litellm","slug":"gcs-bucket-name-is-required","errorCode":null,"errorMessage":"GCS bucket_name is required","messagePattern":"GCS bucket_name is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/files/transformation.py","lineNumber":728,"sourceCode":"            ## 1. If jsonl, derive the object name from the first entry's model\n            first_entry: Final = next(_iter_openai_jsonl_entries(file_data), None)\n            if first_entry is not None:\n                return self._get_gcs_object_name_from_batch_jsonl([first_entry])\n\n        ## 2. If not jsonl, store under a server-generated managed object name\n        filename, _ = extract_file_metadata(file_data)\n        return build_managed_cloud_object_name(\n            prefix=f\"{VERTEX_AI_MANAGED_GCS_PREFIX}uploads/\",\n            filename=filename,\n            fallback_filename=\"file\",\n        )\n\n    def _get_configured_bucket_name(self, litellm_params: dict) -> str:\n        bucket_name: Final = (\n            litellm_params.get(\"gcs_bucket_name\") or litellm_params.get(\"bucket_name\") or os.getenv(\"GCS_BUCKET_NAME\")\n        )\n        if not bucket_name:\n            raise ValueError(\"GCS bucket_name is required\")\n        return bucket_name\n\n    def get_complete_file_url(\n        self,\n        api_base: str | None,\n        api_key: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict,\n        data: CreateFileRequest,\n    ) -> str:\n        \"\"\"\n        Get the complete url for the request\n        \"\"\"\n        bucket_name = self._get_configured_bucket_name(litellm_params)\n        bucket_name, object_prefix = split_configured_cloud_bucket_name(bucket_name)\n        file_data: Final = data.get(\"file\")\n        purpose: Final = data.get(\"purpose\")","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/files/transformation.py#L710-L746","documentation":"Validation when building the GCS upload target for a Vertex AI file: no bucket_name was configured (via litellm_params or default), so there is no destination bucket for the managed upload.","triggerScenarios":"Triggered when a Vertex AI files operation requires a GCS bucket_name but none is provided.","commonSituations":"See trigger scenarios.","solutions":["Provide the GCS bucket_name for file storage."],"exampleFix":"# pass bucket_name in litellm_params for the files call.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}