{"record":{"id":"ec0d080d19a3201b","repo":"BerriAI/litellm","slug":"invalid-cli-login-session-id","errorCode":null,"errorMessage":"Invalid CLI login session id","messagePattern":"Invalid CLI login session id","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":400,"sourceCode":"    )\n    if current_attempts > _CLI_SSO_START_RATE_LIMIT_MAX_ATTEMPTS:\n        raise HTTPException(\n            status_code=429,\n            detail=\"Too many CLI login attempts. Try again later.\",\n        )\n\n\ndef _get_cli_sso_flow_or_raise(login_id: str | None, cache: DualCache) -> dict:\n    if isinstance(login_id, str) and login_id.startswith(\"sk-\"):\n        raise HTTPException(\n            status_code=400,\n            detail=(\n                \"Your litellm CLI is out of date and uses a login flow this proxy no longer supports. \"\n                \"Upgrade it with `pip install -U 'litellm[proxy]'` and run `litellm-proxy login` again.\"\n            ),\n        )\n    if not _is_valid_cli_sso_login_id(login_id):\n        raise HTTPException(status_code=400, detail=\"Invalid CLI login session id\")\n\n    cache_key: Final = _get_cli_sso_flow_cache_key(cast(str, login_id))\n    redis_cache: Final = cache.redis_cache\n    if redis_cache is not None:\n        flow = redis_cache.get_cache(key=cache_key)\n    else:\n        flow = cache.get_cache(key=cache_key)\n    if isinstance(flow, str):\n        try:\n            flow = _as_object(json.loads(flow))\n        except ValueError:\n            flow = None\n    if not isinstance(flow, dict) or \"poll_secret_hash\" not in flow:\n        verbose_proxy_logger.warning(\n            \"CLI SSO login session not found in cache for login_id=%s. If the proxy runs multiple replicas, \"\n            \"a shared Redis cache is required for CLI login to work.\",\n            login_id,\n        )","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L382-L418","documentation":"Error \"Invalid CLI login session id\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `litellm-proxy login` again to start a fresh CLI login 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"}