{"record":{"id":"5e6c63a49f7edb8d","repo":"BerriAI/litellm","slug":"invalid-s3-uri-format-s3-uri","errorCode":null,"errorMessage":"Invalid S3 URI format: {s3_uri}","messagePattern":"Invalid S3 URI format: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/common_utils.py","lineNumber":1409,"sourceCode":"        if model.startswith(\"bedrock/\"):\n            return model[8:]  # Remove \"bedrock/\" prefix\n        return model\n\n    def parse_s3_uri(self, s3_uri: str) -> tuple:\n        \"\"\"\n        Parse S3 URI into bucket and key components.\n\n        Args:\n            s3_uri: S3 URI (e.g., \"s3://bucket/key/path\")\n\n        Returns:\n            Tuple of (bucket, key)\n\n        Raises:\n            ValueError: If URI format is invalid\n        \"\"\"\n        if not s3_uri.startswith(\"s3://\"):\n            raise ValueError(f\"Invalid S3 URI format: {s3_uri}\")\n\n        s3_parts: Final = s3_uri[5:].split(\"/\", 1)  # Remove \"s3://\" and split on first \"/\"\n        if len(s3_parts) != 2:\n            raise ValueError(f\"Invalid S3 URI format: {s3_uri}\")\n\n        return s3_parts[0], s3_parts[1]  # bucket, key\n\n    def extract_model_from_s3_file_path(self, s3_uri: str, optional_params: dict) -> str:\n        \"\"\"\n        Extract model ID from S3 file path.\n\n        The Bedrock file transformation creates S3 objects with the model name embedded:\n        Format: s3://bucket/litellm-bedrock-files-{model}-{uuid}.jsonl\n        \"\"\"\n        # Check if model is provided in optional_params first\n        if \"model\" in optional_params and optional_params[\"model\"]:\n            return self.get_bedrock_model_id_from_litellm_model(optional_params[\"model\"])\n","sourceCodeStart":1391,"sourceCodeEnd":1427,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/common_utils.py#L1391-L1427","documentation":"URI-parsing guard in parse_s3_uri: the supplied string does not start with 's3://', so it cannot be split into bucket and key components. The s3_uri argument (used for batch input/output locations) is the invalid input.","triggerScenarios":"Thrown at litellm/llms/bedrock/common_utils.py:1409 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid S3 URI of the form s3://bucket/key.","Check the s3_uri for missing 's3://' prefix or typos.","URL-encode special characters in the key if needed."],"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"}