{"record":{"id":"c7af8fe28356b081","repo":"theonedev/onedev","slug":"unexpected-setting-0-c7af8f","errorCode":null,"errorMessage":"Unexpected setting: {0}","messagePattern":"Unexpected setting: (.+?)","errorType":"validation","errorClass":"NotAcceptableException","httpStatus":406,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/project/setting/pluginsettings/ContributedProjectSettingPage.java","lineNumber":65,"sourceCode":"\tpublic ContributedProjectSettingPage(PageParameters params) {\n\t\tsuper(params);\n\t\t\n\t\tString settingName = params.get(PARAM_SETTING).toString();\n\t\t\n\t\tfor (ProjectSettingContribution contribution: \n\t\t\t\tOneDev.getExtensions(ProjectSettingContribution.class)) {\n\t\t\tfor (Class<? extends ContributedProjectSetting> each: contribution.getSettingClasses()) {\n\t\t\t\tif (getSettingName(each).equals(settingName)) { \n\t\t\t\t\tsettingClass = each;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (settingClass != null)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (settingClass == null)\n\t\t\tthrow new NotAcceptableException(MessageFormat.format(_T(\"Unexpected setting: {0}\"), settingName));\n\t}\n\t\n\t@Override\n\tprotected void onInitialize() {\n\t\tsuper.onInitialize();\n\t\t\n\t\tString help = EditableUtils.getDescription(settingClass);\n\t\tif (help != null)\n\t\t\tadd(new Label(\"help\", help).setEscapeModelStrings(false));\n\t\telse\n\t\t\tadd(new WebMarkupContainer(\"help\").setVisible(false));\n\t\t\n\t\tForm<?> form = new Form<Void>(\"form\") {\n\n\t\t\t@Override\n\t\t\tprotected void onSubmit() {\n\t\t\t\tsuper.onSubmit();\n\t\t\t\t","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/project/setting/pluginsettings/ContributedProjectSettingPage.java#L47-L83","documentation":"ContributedProjectSettingPage resolves the 'setting' URL parameter to a project setting class contributed via ProjectConfigurations; when the given settingName matches no contributor it throws NotAcceptableException. It guards against unknown or misspelled setting page names.","triggerScenarios":"Navigating to the project settings plugin page with a 'setting' parameter that no extension contributes, e.g. a renamed, removed, or typo'd setting name; stale links after an upgrade removed/renamed a contributed setting.","commonSituations":"Bookmarks to a setting page that was renamed between OneDev versions; hand-built URLs to plugin settings; third-party plugin uninstalled so its setting name no longer resolves.","solutions":["Use the project settings menu to navigate to the desired setting page rather than a hand-written URL.","Check the exact setting name registered by the contributing plugin and correct the URL parameter.","Update stale bookmarks/links after OneDev upgrades; reinstall the plugin that contributed the setting."],"exampleFix":"// before\nopen(projectUrl + \"/~settings/plugin?setting=MyOldSettingName\");\n// after\nopen(projectUrl + \"/~settings/plugin?setting=\" + ProjectConfigurations.SETTING_NAME);","handlingStrategy":"validation","validationCode":"boolean known = OneDev.getExtensions(ProjectSettingContributor.class).stream()\n    .anyMatch(c -> c.getSettingNames().contains(settingName));\nif (!known) throw new IllegalArgumentException(\"Unknown project setting: \" + settingName);","typeGuard":"Class<? extends ProjectSetting> resolveSetting(String name) { /* return null when no contributor matches */ }","tryCatchPattern":"try { openPluginSetting(name); } catch (NotAcceptableException e) { openSettingsMenuInstead(); }","preventionTips":["Generate setting URLs from contributor constants, not hand-typed names.","Re-check plugin-contributed setting URLs after upgrades or plugin removal.","Use the settings UI navigation rather than constructing plugin URLs manually."],"tags":["wicket","settings","plugin","url-parameter"],"backgroundTag":"invalid-argument-value","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"}