{"record":{"id":"42d11425a2583ad2","repo":"BerriAI/litellm","slug":"file-content-is-required","errorCode":null,"errorMessage":"file content is required","messagePattern":"file content is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":360,"sourceCode":"        named as: litellm-bedrock-files/{model}/{uuid}\n        \"\"\"\n        _model = openai_jsonl_content[0].get(\"body\", {}).get(\"model\", \"\")\n        # Remove bedrock/ prefix if present\n        _model = _model.removeprefix(\"bedrock/\")\n\n        safe_model: Final = sanitize_cloud_object_component(_model.replace(\":\", \"-\"), fallback=\"model\")\n\n        object_name: Final = f\"{BEDROCK_MANAGED_S3_BATCH_PREFIX}{safe_model}-{uuid.uuid4()}.jsonl\"\n        return object_name\n\n    def get_object_name(self, extracted_file_data: ExtractedFileData, purpose: str) -> str:\n        \"\"\"\n        Get the object name for the request\n        \"\"\"\n        extracted_file_data_content: Final = extracted_file_data.get(\"content\")\n\n        if extracted_file_data_content is None:\n            raise ValueError(\"file content is required\")\n\n        if purpose == \"batch\":\n            ## 1. If jsonl, check if there's a model name\n            file_content: Final = self._get_content_from_openai_file(extracted_file_data_content)\n\n            # Split into lines and parse each line as JSON\n            openai_jsonl_content: Final = [json.loads(line) for line in file_content.splitlines() if line.strip()]\n            if len(openai_jsonl_content) > 0:\n                return self._get_s3_object_name_from_batch_jsonl(openai_jsonl_content)\n\n        ## 2. If not jsonl, store under a server-generated managed object name\n        filename: Final = extracted_file_data.get(\"filename\")\n        return build_managed_cloud_object_name(\n            prefix=BEDROCK_MANAGED_S3_UPLOAD_PREFIX,\n            filename=filename,\n            fallback_filename=\"file\",\n        )\n","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/files/transformation.py#L342-L378","documentation":"Content guard in the Bedrock files transformation: constructing the upload payload requires actual file content (the bytes to write to S3), and none was present on the extracted file data, so the put-object request cannot be formed.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the file content in the upload request.","Check the multipart form includes the file payload.","Verify the client is not sending an empty body."],"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"}