{"record":{"id":"2705ca9a6b88405a","repo":"invoke-ai/InvokeAI","slug":"user-not-found-or-inactive","errorCode":null,"errorMessage":"User not found or inactive","messagePattern":"User not found or inactive","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"invokeai/app/api/auth_dependencies.py","lineNumber":80,"sourceCode":"    # `_identify_video_upload_user`). So this refuses only real, minted tokens.\n    if token_data.user_id == SYSTEM_USER_ID:\n        return None\n    user = ApiDependencies.invoker.services.users.get(token_data.user_id)\n    if user is None or not user.is_active:\n        return None\n    if token_data.token_epoch != user.token_epoch:\n        return None\n    return user\n\n\ndef _validate_token(token: str, invalid_detail: str) -> TokenData:\n    token_data = verify_token(token)\n    if token_data is None:\n        raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail=invalid_detail)\n\n    user = resolve_authorized_user(token_data)\n    if user is None:\n        raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail=\"User not found or inactive\")\n    return _db_derived_token_data(token_data, user)\n\n\ndef _db_derived_token_data(token_data: TokenData, user: \"UserDTO\") -> TokenData:\n    \"\"\"Build TokenData whose authorization fields come from the database record.\n\n    The JWT proves *identity* only. Authorization (``is_admin``) must reflect the\n    current database state on every request; otherwise a demoted administrator\n    keeps admin rights until their token expires — and sliding-window refresh\n    would renew that stale claim indefinitely. A promoted user symmetrically\n    gains admin rights on their next request without re-login.\n\n    The epoch is carried through from the record so a refreshed token stays valid\n    (callers only reach here once ``_token_epoch_is_current`` has passed).\n    \"\"\"\n    return TokenData(\n        user_id=user.user_id,\n        email=user.email,","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/auth_dependencies.py#L62-L98","documentation":"ERSDEScheduler.__init__ validates prediction_type at construction and accepts only 'epsilon', 'v_prediction', or 'flow_prediction'. Any other string (or a misnamed alias like 'sample'/'flow') is rejected because the step logic in _convert_model_output can only invert those three parameterizations.","triggerScenarios":"Passing e.g. prediction_type='sample', 'linear_prediction', or a config copied from a non-ER-SDE scheduler into ERSDEScheduler(...). Also raised when prediction_type is loaded from a scheduler config JSON written by a different library version.","commonSituations":"Copying scheduler kwargs from diffusers Euler/Scheduler configs that allow 'sample', typos like 'flow', or pipeline code that forwards the base model's prediction type without mapping it to one of the three supported values.","solutions":["Set prediction_type to one of 'epsilon', 'v_prediction', 'flow_prediction'","Map the upstream model's prediction type before constructing the scheduler (e.g. 'sample' -> 'epsilon')","Fix the scheduler_config.json / model config entry that carries the invalid value","Update InvokeAI if the checkpoint uses a newer prediction type the current version rejects"],"exampleFix":"// before\nsched = ERSDEScheduler(prediction_type=\"sample\")\n// after\nsched = ERSDEScheduler(prediction_type=\"epsilon\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"epsilon\", \"v_prediction\", \"flow_prediction\"}\nassert prediction_type in ALLOWED, prediction_type","typeGuard":"def is_valid_prediction_type(pt) -> bool:\n    return pt in (\"epsilon\", \"v_prediction\", \"flow_prediction\")","tryCatchPattern":"try:\n    sched = ERSDEScheduler(prediction_type=prediction_type)\nexcept ValueError as e:\n    if \"prediction_type\" in str(e):\n        sched = ERSDEScheduler(prediction_type=\"epsilon\")\n    else:\n        raise","preventionTips":["Only pass the three documented values","Map foreign scheduler prediction types before constructing","Keep scheduler config JSONs aligned with this scheduler's schema","Log the full constructor kwargs when debugging 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"}