{"record":{"id":"93ddf31e31903c94","repo":"BerriAI/litellm","slug":"cli-login-is-not-ready","errorCode":null,"errorMessage":"CLI login is not ready","messagePattern":"CLI login is not ready","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":804,"sourceCode":"        login_id=login_id,\n        poll_secret=poll_secret,\n        user_code=user_code,\n        verification_uri_complete=verification_uri_complete,\n    )\n\n\n@router.post(\"/sso/cli/complete/{login_id}\", tags=[\"experimental\"], include_in_schema=False)\nasync def cli_sso_complete(request: Request, login_id: str):\n    from fastapi.responses import HTMLResponse\n\n    from litellm.proxy.common_utils.html_forms.cli_sso_success import (\n        render_cli_sso_success_page,\n    )\n    from litellm.proxy.proxy_server import cli_sso_session_cache\n\n    flow: Final = _get_cli_sso_flow_or_raise(login_id=login_id, cache=cli_sso_session_cache)\n    if not flow.get(\"sso_complete\") or not flow.get(\"session_data\"):\n        raise HTTPException(status_code=400, detail=\"CLI login is not ready\")\n\n    body: Final = (await request.body()).decode(\"utf-8\")\n    form_values: Final = parse_qs(body)\n    supplied_user_code: Final = (form_values.get(\"user_code\") or [\"\"])[0]\n    supplied_browser_complete_token: Final = (form_values.get(\"browser_complete_token\") or [\"\"])[0]\n    supplied_user_code_hash: Final = _hash_cli_sso_secret(_normalize_cli_sso_user_code(supplied_user_code))\n    supplied_browser_complete_token_hash: Final = _hash_cli_sso_secret(supplied_browser_complete_token)\n\n    expected_user_code_hash: Final = flow.get(\"user_code_hash\")\n    if not isinstance(expected_user_code_hash, str) or not secrets.compare_digest(\n        supplied_user_code_hash, expected_user_code_hash\n    ):\n        raise HTTPException(status_code=400, detail=\"Invalid verification code\")\n\n    expected_browser_complete_token_hash: Final = flow.get(\"browser_complete_token_hash\")\n    if not isinstance(expected_browser_complete_token_hash, str) or not secrets.compare_digest(\n        supplied_browser_complete_token_hash, expected_browser_complete_token_hash\n    ):","sourceCodeStart":786,"sourceCodeEnd":822,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L786-L822","documentation":"Error \"CLI login is not ready\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:804 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The CLI login is still pending; complete the browser sign-in, then poll again."],"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"}