{"record":{"id":"49aeddc4099a4920","repo":"BerriAI/litellm","slug":"invalid-cli-polling-secret","errorCode":null,"errorMessage":"Invalid CLI polling secret","messagePattern":"Invalid CLI polling secret","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":2430,"sourceCode":"):\n    \"\"\"\n    CLI polling endpoint - retrieves session from cache and generates JWT.\n\n    Flow:\n    1. First poll (no team_id): Returns teams list without generating JWT\n    2. Second poll (with team_id): Generates JWT with selected team and deletes session\n\n    Args:\n        key_id: The CLI login session ID\n        team_id: Optional team ID to assign to the JWT. If provided, must be one of user's teams.\n    \"\"\"\n    from litellm.proxy.auth.auth_checks import ExperimentalUIJWTToken\n    from litellm.proxy.proxy_server import cli_sso_session_cache\n\n    try:\n        flow: Final = _get_cli_sso_flow_or_raise(login_id=key_id, cache=cli_sso_session_cache)\n        if not _verify_cli_sso_poll_secret(flow=flow, poll_secret=x_litellm_cli_poll_secret):\n            raise HTTPException(status_code=403, detail=\"Invalid CLI polling secret\")\n\n        if not flow.get(\"sso_complete\") or not flow.get(\"user_code_verified\"):\n            return {\"status\": \"pending\"}\n\n        session_data: Final = flow.get(\"session_data\")\n\n        if isinstance(session_data, dict):\n            user_teams: Final = session_data.get(\"teams\", [])\n            user_team_details: Final = session_data.get(\"team_details\")\n            user_id: Final = session_data[\"user_id\"]\n\n            verbose_proxy_logger.info(\n                \"CLI poll: user=%s, team_id=%s, user_teams=%s, num_teams=%s\",\n                user_id,\n                team_id,\n                user_teams,\n                len(user_teams),\n            )","sourceCodeStart":2412,"sourceCodeEnd":2448,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L2412-L2448","documentation":"Error \"Invalid CLI polling secret\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:2430 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restart the CLI login flow to obtain a fresh polling secret; do not reuse an old session."],"exampleFix":null,"handlingStrategy":null,"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-14T05:17:10.506Z"}