{"record":{"id":"9986132e6256d81c","repo":"invoke-ai/InvokeAI","slug":"multiuser-mode-is-disabled-admin-setup-is-not-req","errorCode":null,"errorMessage":"Multiuser mode is disabled. Admin setup is not required in single-user mode.","messagePattern":"Multiuser mode is disabled\\. Admin setup is not required in single-user mode\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"warning","filePath":"invokeai/app/api/routers/auth.py","lineNumber":375,"sourceCode":"\n    This endpoint can only be called once, when no admin user exists. It creates\n    the first admin user for the system.\n\n    Args:\n        request: Admin account details (email, display_name, password)\n\n    Returns:\n        SetupResponse containing the created admin user\n\n    Raises:\n        HTTPException: 400 if admin already exists or password is weak\n        HTTPException: 403 if multiuser mode is disabled\n    \"\"\"\n    config = ApiDependencies.invoker.services.configuration\n\n    # Check if multiuser is enabled\n    if not config.multiuser:\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            detail=\"Multiuser mode is disabled. Admin setup is not required in single-user mode.\",\n        )\n\n    user_service = ApiDependencies.invoker.services.users\n\n    # Check if any admin exists\n    if user_service.has_admin():\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=\"Administrator account already configured\",\n        )\n\n    # Create admin user - this will validate password strength\n    try:\n        user_data = UserCreateRequest(\n            email=request.email,\n            display_name=request.display_name,","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/auth.py#L357-L393","documentation":"The /auth/setup endpoint exists only to create the first admin in multiuser mode. When multiuser is off, admin setup is unnecessary (there's a single implicit user), so setup_admin raises 403 with this detail before doing anything.","triggerScenarios":"POSTing to /auth/setup (setup_admin) on a server started without multiuser enabled.","commonSituations":"Setup wizard or bootstrap script unconditionally calling setup; running the same onboarding flow against a single-user install; environment where multiuser was turned off after the client was configured for multiuser onboarding.","solutions":["Enable multiuser (invokeai-web --multiuser) before running setup","Skip the setup step in single-user mode — no admin account is needed","Gate onboarding code on a multiuser flag/capability endpoint","Update automation scripts to detect mode before calling /auth/setup"],"exampleFix":"// before\nawait api.post('/auth/setup', adminPayload); // 403 in single-user mode\n// after\nif (serverConfig.multiuser) { await api.post('/auth/setup', adminPayload); }","handlingStrategy":"fallback","validationCode":"cfg = requests.get(f'{base}/app/config').json()\nif not cfg.get('multiuser', False):\n    print('Single-user mode: admin setup not needed, skipping /auth/setup')","typeGuard":"def needs_admin_setup(server_config: dict) -> bool:\n    return bool(server_config.get('multiuser', False))","tryCatchPattern":"try:\n    resp = requests.post(f'{base}/auth/setup', json=payload)\n    resp.raise_for_status()\nexcept requests.HTTPError as e:\n    if e.response.status_code == 403 and 'single-user' in e.response.json().get('detail', ''):\n        skip_setup_and_continue()","preventionTips":["Check multiuser mode before running onboarding/setup flows","Skip /auth/setup entirely for single-user installs","Enable --multiuser first if you actually need admin setup","Gate setup wizard steps on server capability flags"],"tags":["http-403","authentication","config"],"backgroundTag":"auth-not-required-single-user-mode","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}