{"record":{"id":"5176e6e9f37fb834","repo":"theonedev/onedev","slug":"server-not-set-up-yet","errorCode":null,"errorMessage":"Server not set up yet","messagePattern":"Server not set up yet","errorType":"console","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/commandhandler/EnableInternalLogin.java","lineNumber":69,"sourceCode":"\t\tSecurityUtils.bindAsSystem();\n\n\t\ttry {\n\t\t\tdoMaintenance(() -> {\n\t\t\t\tsessionFactoryService.start();\n\n\t\t\t\ttry (var conn = dataService.openConnection()) {\n\t\t\t\t\tcallWithTransaction(conn, () -> {\n\t\t\t\t\t\tdataService.checkDataVersion(conn, false);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t});\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\n\t\t\t\ttransactionService.run(() -> {\n\t\t\t\t\tvar setting = settingService.findSetting(Key.SECURITY);\n\t\t\t\t\tif (setting == null || setting.getValue() == null)\n\t\t\t\t\t\tthrow new ExplicitException(\"Server not set up yet\");\n\t\t\t\t\tvar securitySetting = (SecuritySetting) setting.getValue();\n\t\t\t\t\tsecuritySetting.setDisableInternalLogin(false);\n\t\t\t\t\tsetting.setValue(securitySetting);\n\t\t\t\t});\n\n\t\t\t\tlogger.info(\"Internal login form has been enabled\");\n\t\t\t\treturn null;\n\t\t\t});\n\t\t\tSystem.exit(0);\n\t\t} catch (ExplicitException e) {\n\t\t\tlogger.error(e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void stop() {\n\t\tsessionFactoryService.stop();","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/commandhandler/EnableInternalLogin.java#L51-L87","documentation":"The enable-internal-login command handler re-enables the internal login form by flipping SecuritySetting.disableInternalLogin to false. Before mutating, it looks up the SECURITY setting; if no security setting exists the server has not completed initial setup (admin account/initial configuration not created), so it throws 'Server not set up yet'.","triggerScenarios":"Running the 'enable-internal-login' server command against a OneDev installation whose bootstrap/setup has never completed, i.e. no SecuritySetting record persisted under Key.SECURITY.","commonSituations":"Running the command before ever opening the web UI and completing the initial setup wizard; pointing the command at an empty/uninitialized site directory; fresh container deployment where setup was never finished.","solutions":["Complete the initial server setup via the web UI first (create admin, finish wizard), then re-run the command.","Verify you are running the command against the correct site/data directory of an already-set-up instance.","If the security setting was accidentally deleted, restore it from backup or let setup recreate it.","Check server logs to confirm the instance completed bootstrap and data migration before issuing the command."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before running the command, confirm setup completed\nboolean setupDone = new File(siteDir, \"site\").exists()\n    && securitySettingService.findSetting(Key.SECURITY) != null;","typeGuard":null,"tryCatchPattern":"try {\n    new EnableInternalLogin(...).start();\n} catch (ExplicitException e) {\n    if (e.getMessage().contains(\"Server not set up yet\"))\n    logger.error(\"Complete initial server setup via web UI before running this command\");\n}","preventionTips":["Always complete the web setup wizard before issuing server maintenance commands.","Run commands against the documented site directory of the set-up instance.","Script pre-checks that verify the SECURITY setting exists before automating commands."],"tags":["setup","server-command","precondition"],"backgroundTag":"invalid-state-transition","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}