{"record":{"id":"7875f18464e7f838","repo":"BerriAI/litellm","slug":"file-is-required","errorCode":null,"errorMessage":"file is required","messagePattern":"file is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":405,"sourceCode":"    ) -> str:\n        \"\"\"\n        Get the complete S3 URL for the file upload request\n        \"\"\"\n        request_params: Final = merge_bedrock_aws_request_params(litellm_params, optional_params)\n        bucket_name = litellm_params.get(\"s3_bucket_name\") or os.getenv(\"AWS_S3_BUCKET_NAME\")\n        if not bucket_name:\n            raise ValueError(\n                \"S3 bucket_name is required. Set 's3_bucket_name' in litellm_params or AWS_S3_BUCKET_NAME env var\"\n            )\n        bucket_name, object_prefix = split_configured_cloud_bucket_name(bucket_name)\n\n        s3_region_name: Final = litellm_params.get(\"s3_region_name\") or optional_params.get(\"s3_region_name\")\n        aws_region_name: Final = s3_region_name or self._get_aws_region_name(request_params, model)\n\n        file_data: Final = data.get(\"file\")\n        purpose: Final = data.get(\"purpose\")\n        if file_data is None:\n            raise ValueError(\"file is required\")\n        if purpose is None:\n            raise ValueError(\"purpose is required\")\n        extracted_file_data: Final = extract_file_data(file_data)\n        object_name = self.get_object_name(extracted_file_data, purpose)\n        if object_prefix:\n            object_name = f\"{object_prefix}/{object_name}\"\n        encoded_object_name: Final = encode_s3_object_key_for_url(object_name)\n\n        # S3 endpoint URL format\n        s3_endpoint_url: Final = (\n            request_params.get(\"s3_endpoint_url\") or f\"https://s3.{aws_region_name}.amazonaws.com\"\n        ).rstrip(\"/\")\n\n        return f\"{s3_endpoint_url}/{bucket_name}/{encoded_object_name}\"\n\n    def get_supported_openai_params(self, model: str) -> list[OpenAICreateFileRequestOptionalParams]:\n        return []\n","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/files/transformation.py#L387-L423","documentation":"Field guard while building the Bedrock file-upload request: the file object/data itself is missing, so the multipart/upload body cannot be constructed even though bucket configuration succeeded.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Attach the file in the upload request (multipart 'file' field).","Verify the client sends a non-empty file payload.","Check the request uses the correct multipart encoding."],"exampleFix":null,"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-23T08:17:48.524Z"}