{"record":{"id":"c44de6f5c434dea7","repo":"invoke-ai/InvokeAI","slug":"missing-authentication-credentials","errorCode":null,"errorMessage":"Missing authentication credentials","messagePattern":"Missing authentication credentials","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"invokeai/app/api/auth_dependencies.py","lineNumber":124,"sourceCode":"    credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(security)],\n) -> TokenData:\n    \"\"\"Get current authenticated user from Bearer token.\n\n    Note: This function accesses ApiDependencies.invoker.services.users directly,\n    which is the established pattern in this codebase. The ApiDependencies.invoker\n    is initialized in the FastAPI lifespan context before any requests are handled.\n\n    Args:\n        credentials: The HTTP authorization credentials containing the Bearer token\n\n    Returns:\n        TokenData containing user information from the token\n\n    Raises:\n        HTTPException: If token is missing, invalid, or expired (401 Unauthorized)\n    \"\"\"\n    if credentials is None:\n        raise HTTPException(\n            status_code=status.HTTP_401_UNAUTHORIZED,\n            detail=\"Missing authentication credentials\",\n            headers={\"WWW-Authenticate\": \"Bearer\"},\n        )\n\n    token = credentials.credentials\n    token_data = verify_token(token)\n\n    if token_data is None:\n        raise HTTPException(\n            status_code=status.HTTP_401_UNAUTHORIZED,\n            detail=\"Invalid or expired authentication token\",\n            headers={\"WWW-Authenticate\": \"Bearer\"},\n        )\n\n    # Verify the token still grants access: user exists, is active, epoch is current.\n    user = resolve_authorized_user(token_data)\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/auth_dependencies.py#L106-L142","documentation":"solver_order controls the ER-SDE update order; __init__ restricts it to 1, 2, or 3 because only first-, second-, and third-order update rules are implemented. Values outside this set (0, 4, negative, non-int) raise this ValueError.","triggerScenarios":"Constructing ERSDEScheduler with solver_order=0, 4, a float like 2.5, or a None leaking from a config dict; also when a UI/model config stores an order value copied from another scheduler family with a wider range.","commonSituations":"Experimenting with higher-order solvers assuming order 4 exists, config round-trips that turn ints into strings, and pipeline presets from other samplers (e.g. DPM-Solver++ S orders).","solutions":["Pass solver_order=1, 2, or 3 (2 is a good default for quality/speed)","Clamp/validate the order before constructing: solver_order = min(max(int(solver_order), 1), 3)","Fix the model/UI preset that stores an unsupported order","Implement/await a higher-order update in the scheduler if order 4+ is genuinely needed"],"exampleFix":"// before\nsched = ERSDEScheduler(solver_order=4)\n// after\nsched = ERSDEScheduler(solver_order=3)","handlingStrategy":"validation","validationCode":"assert solver_order in (1, 2, 3), f\"bad solver_order={solver_order}\"","typeGuard":"def is_valid_solver_order(o) -> bool:\n    return isinstance(o, int) and o in (1, 2, 3)","tryCatchPattern":"try:\n    sched = ERSDEScheduler(solver_order=solver_order)\nexcept ValueError as e:\n    if \"solver_order\" in str(e):\n        sched = ERSDEScheduler(solver_order=2)\n    else:\n        raise","preventionTips":["Clamp order to [1, 3] from UI/config input","Don't copy solver_order values from other sampler families","Store orders as ints, not strings, in configs"],"tags":["scheduler","config-validation","valueerror","diffusion"],"backgroundTag":"invalid-enum-value","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}