{"record":{"id":"e345a03c2729fe6c","repo":"BerriAI/litellm","slug":"invalid-arn-format-batch-id","errorCode":null,"errorMessage":"Invalid ARN format: {batch_id}","messagePattern":"Invalid ARN format: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/batches/transformation.py","lineNumber":381,"sourceCode":"\n        Args:\n            batch_id: Bedrock job ARN\n            optional_params: Optional parameters\n            litellm_params: LiteLLM parameters\n\n        Returns:\n            Transformed request data for Bedrock GetModelInvocationJob API\n        \"\"\"\n        # For Bedrock, batch_id should be the full job ARN\n        # The GetModelInvocationJob API expects the full ARN as the identifier\n        if not batch_id.startswith(\"arn:aws:bedrock:\"):\n            raise ValueError(f\"Invalid batch_id format. Expected ARN, got: {batch_id}\")\n\n        # Extract the job identifier from the ARN - use the full ARN path part\n        # ARN format: arn:aws:bedrock:region:account:model-invocation-job/job-name\n        arn_parts: Final = batch_id.split(\":\")\n        if len(arn_parts) < 6:\n            raise ValueError(f\"Invalid ARN format: {batch_id}\")\n\n        region: Final = arn_parts[3]\n        if not re.match(r\"^[a-z][a-z0-9-]*$\", region):\n            raise ValueError(f\"Invalid region in ARN: {batch_id}\")\n\n        # Build the endpoint URL for GetModelInvocationJob\n        # AWS API format: GET /model-invocation-job/{jobIdentifier}\n        # Use the FULL ARN as jobIdentifier and URL-encode it (includes ':' and '/')\n        import urllib.parse as _ul\n\n        encoded_arn: Final = _ul.quote(batch_id, safe=\"\")\n        endpoint_url: Final = f\"https://bedrock.{region}.amazonaws.com/model-invocation-job/{encoded_arn}\"\n\n        # Use common utility for AWS signing\n        request_params: Final = merge_bedrock_aws_request_params(litellm_params, optional_params)\n        signed_headers, _ = self.common_utils.sign_aws_request(\n            service_name=\"bedrock\",\n            data={},  # GET request has no body","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/batches/transformation.py#L363-L399","documentation":"Error \"Invalid ARN format: {batch_id}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/batches/transformation.py:381 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid ARN string."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}