{"record":{"id":"16f9ee2457cfdffe","repo":"theonedev/onedev","slug":"unrecognized-command","errorCode":null,"errorMessage":"Unrecognized command: ","messagePattern":"Unrecognized command: ","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"server-core/src/main/java/io/onedev/server/CoreModule.java","lineNumber":954,"sourceCode":"\t\t\t\treturn RestoreDatabase.class;\n\t\t\telse if (ApplyDatabaseConstraints.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn ApplyDatabaseConstraints.class;\n\t\t\telse if (BackupDatabase.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn BackupDatabase.class;\n\t\t\telse if (CheckDataVersion.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn CheckDataVersion.class;\n\t\t\telse if (Upgrade.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn Upgrade.class;\n\t\t\telse if (CleanDatabase.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn CleanDatabase.class;\n\t\t\telse if (ResetAdminPassword.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn ResetAdminPassword.class;\n\t\t\telse if (EnableInternalLogin.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn EnableInternalLogin.class;\n\t\t\telse if (Translate.COMMAND.equals(Bootstrap.command.getName()))\n\t\t\t\treturn Translate.class;\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"Unrecognized command: \" + Bootstrap.command.getName());\n\t\t} else {\n\t\t\treturn OneDev.class;\n\t\t}\t\t\n\t}\n\n}\n","sourceCodeStart":936,"sourceCodeEnd":961,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/CoreModule.java#L936-L961","documentation":"During bootstrap, OneDev's Guice module selects a plugin/application class based on the CLI command that started the server. If Bootstrap.command is set to a command name the module does not recognize, it throws this RuntimeException and startup aborts.","triggerScenarios":"Starting OneDev with a -Dbootstrap.command (or equivalent) value that is not resetAdminPassword, enableInternalLogin, or translate, so getPluginClass falls through the else branch and throws.","commonSituations":"Typo in the command name, running a stripped/older build where the command class was removed, launching the jar with a leftover bootstrap.command property from a previous invocation, or scripting tools that pass an unexpected command.","solutions":["Check the exact command name passed via the bootstrap.command property and correct the spelling/case to a supported command (ResetAdminPassword, EnableInternalLogin, Translate) or remove the property entirely to start the normal server.","Verify the OneDev version: if you rely on a command added in a newer release, upgrade the jar so CoreModule recognizes it.","Run without any command property so the else branch returns the normal OneDev application class.","If you intentionally added a custom command, register it in CoreModule.getPluginClass's if/else chain."],"exampleFix":"// before\njava -jar onedev.jar --bootstrap.command=restAdminPassword\n// after\njava -jar onedev.jar --bootstrap.command=resetAdminPassword","handlingStrategy":"validation","validationCode":"String cmd = System.getProperty(\"bootstrap.command\");\nSet<String> supported = Set.of(\"resetAdminPassword\",\"enableInternalLogin\",\"translate\");\nif (cmd != null && !supported.contains(cmd))\n    throw new IllegalArgumentException(\"Unsupported bootstrap command: \" + cmd);","typeGuard":null,"tryCatchPattern":"try {\n    startServer(args);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Unrecognized command:\")) {\n        System.err.println(\"Fix --bootstrap.command value or omit it; supported: resetAdminPassword, enableInternalLogin, translate\");\n    }\n}","preventionTips":["Always pass exact supported command names (case-sensitive).","Omit the bootstrap.command property for normal server startup.","Pin the OneDev version in scripts to avoid commands removed/renamed in upgrades."],"tags":["bootstrap","cli","startup","configuration"],"backgroundTag":"invalid-cli-argument","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}