{"record":{"id":"a7ad26f75d090589","repo":"BerriAI/litellm","slug":"invalid-arn-format-arn","errorCode":null,"errorMessage":"Invalid ARN format: {arn}","messagePattern":"Invalid ARN format: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/chat/agentcore/transformation.py","lineNumber":177,"sourceCode":"        returns: \"arn:aws:bedrock-agentcore:us-west-2:888602223428:runtime/hosted_agent_r9jvp-3ySZuRHjLC\"\n        \"\"\"\n        parts: Final = model.split(\"/\", 1)\n        if len(parts) != 2 or parts[0] != \"agentcore\":\n            raise ValueError(\n                \"Invalid model format. Expected format: 'model=bedrock/agentcore/arn:aws:bedrock-agentcore:region:account:runtime/runtime_id'\"\n            )\n        return parts[1]\n\n    def _extract_region_from_arn(self, arn: str) -> str:\n        \"\"\"\n        Extract region from ARN\n        arn:aws:bedrock-agentcore:us-west-2:888602223428:runtime/hosted_agent_r9jvp-3ySZuRHjLC\n        returns: us-west-2\n        \"\"\"\n        parts: Final = arn.split(\":\")\n        if len(parts) >= 4:\n            return parts[3]\n        raise ValueError(f\"Invalid ARN format: {arn}\")\n\n    def _get_runtime_session_id(self, optional_params: dict) -> str:\n        \"\"\"\n        Get or generate runtime session ID (must be 33+ chars)\n        \"\"\"\n        session_id: Final = optional_params.get(\"runtimeSessionId\", None)\n        if session_id:\n            verbose_logger.debug(\"Using provided runtimeSessionId: %s\", session_id)\n            return session_id\n\n        # Generate a session ID with 33+ characters\n        generated_id: Final = f\"litellm-session-{uuid.uuid4()}\"\n        verbose_logger.debug(\"Generated new session ID: %s\", generated_id)\n        return generated_id\n\n    def _get_runtime_user_id(self, optional_params: dict) -> str | None:\n        \"\"\"\n        Get runtime user ID if provided","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/chat/agentcore/transformation.py#L159-L195","documentation":"Error \"Invalid ARN format: {arn}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/chat/agentcore/transformation.py:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid AgentCore 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-15T22:17:37.221Z"}