theonedev/onedev · error · NotAcceptableException

Unexpected setting

Error message

Unexpected setting: {0}

What it means

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.

Solutions

  1. Use the project settings menu to navigate to the desired setting page rather than a hand-written URL.
  2. Check the exact setting name registered by the contributing plugin and correct the URL parameter.
  3. Update stale bookmarks/links after OneDev upgrades; reinstall the plugin that contributed the setting.

Example fix

// before
open(projectUrl + "/~settings/plugin?setting=MyOldSettingName");
// after
open(projectUrl + "/~settings/plugin?setting=" + ProjectConfigurations.SETTING_NAME);
Defensive patterns

Strategy: validation

Validate before calling

boolean known = OneDev.getExtensions(ProjectSettingContributor.class).stream()
    .anyMatch(c -> c.getSettingNames().contains(settingName));
if (!known) throw new IllegalArgumentException("Unknown project setting: " + settingName);

Type guard

Class<? extends ProjectSetting> resolveSetting(String name) { /* return null when no contributor matches */ }

Try / catch

try { openPluginSetting(name); } catch (NotAcceptableException e) { openSettingsMenuInstead(); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/c7af8fe28356b081. Report an issue: GitHub.

Appendix: source

Thrown at server-core/src/main/java/io/onedev/server/web/page/project/setting/pluginsettings/ContributedProjectSettingPage.java:65

	public ContributedProjectSettingPage(PageParameters params) {
		super(params);
		
		String settingName = params.get(PARAM_SETTING).toString();
		
		for (ProjectSettingContribution contribution: 
				OneDev.getExtensions(ProjectSettingContribution.class)) {
			for (Class<? extends ContributedProjectSetting> each: contribution.getSettingClasses()) {
				if (getSettingName(each).equals(settingName)) { 
					settingClass = each;
					break;
				}
			}
			if (settingClass != null)
				break;
		}

		if (settingClass == null)
			throw new NotAcceptableException(MessageFormat.format(_T("Unexpected setting: {0}"), settingName));
	}
	
	@Override
	protected void onInitialize() {
		super.onInitialize();
		
		String help = EditableUtils.getDescription(settingClass);
		if (help != null)
			add(new Label("help", help).setEscapeModelStrings(false));
		else
			add(new WebMarkupContainer("help").setVisible(false));
		
		Form<?> form = new Form<Void>("form") {

			@Override
			protected void onSubmit() {
				super.onSubmit();
				

View on GitHub (pinned to d44925c47c)