{"record":{"id":"508fce7c1acc1d26","repo":"BerriAI/litellm","slug":"invalid-region-in-arn-batch-id","errorCode":null,"errorMessage":"Invalid region in ARN: {batch_id}","messagePattern":"Invalid region in ARN: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/batches/transformation.py","lineNumber":385,"sourceCode":"            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\n            endpoint_url=endpoint_url,\n            optional_params=request_params,\n            method=\"GET\",\n        )","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/batches/transformation.py#L367-L403","documentation":"Error \"Invalid region in ARN: {batch_id}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/batches/transformation.py:385 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The ARN contains an invalid region; correct the region in the ARN."],"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"}