theonedev/onedev · error · ExplicitException

No any issue state is defined

Error message

No any issue state is defined

What it means

GlobalIssueSetting.getInitialStateSpec() returns the first state in the configured issue states list as the initial state. If no issue states are defined at all (empty stateSpecs), there is no valid initial state, so it throws this ExplicitException. This indicates broken/corrupted global issue configuration.

Source

Thrown at server-core/src/main/java/io/onedev/server/model/support/administration/GlobalIssueSetting.java:703

		}
		
		index = 1;
		for (IssueTemplate template: getIssueTemplates()) 
			usage.add(template.getQueryUpdater().onDeleteLink(linkName).prefix("description template #" + index++));
		
		if (listLinks.contains(linkName))
			usage.add(new Usage().add("fields & links").prefix("-> issues"));
		
		usage.add(timeTrackingSetting.onDeleteLink(linkName).prefix("time tracking"));
		
		return usage.prefix("issue settings");
	}
	
	public StateSpec getInitialStateSpec() {
		if (!getStateSpecs().isEmpty())
			return getStateSpecs().iterator().next();
		else
			throw new ExplicitException("No any issue state is defined");
	}
	
	@NotNull
	@Valid
	public List<BoardSpec> getBoardSpecs() {
		return boardSpecs;
	}

	public void setBoardSpecs(List<BoardSpec> boardSpecs) {
		this.boardSpecs = boardSpecs;
	}

	@NotNull
	@Valid
	public TimeTrackingSetting getTimeTrackingSetting() {
		return timeTrackingSetting;
	}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Go to Administration → Issue Settings → States and add at least one state (e.g. 'Open'), making it first so it becomes the initial state
  2. Restore default issue states by resetting the GlobalIssueSetting to defaults
  3. Check the DB settings row if the UI appears correct — the stateSpecs list may be empty due to a serialization issue

Example fix

// before (unsafe)
StateSpec initial = OneDev.getInstance(SettingService.class).getIssueSetting().getInitialStateSpec();
// after
var issueSetting = OneDev.getInstance(SettingService.class).getIssueSetting();
if (issueSetting.getStateSpecs().isEmpty()) {
    logger.error("No issue states configured");
    return;
}
StateSpec initial = issueSetting.getInitialStateSpec();
Defensive patterns

Strategy: validation

Validate before calling

var setting = OneDev.getInstance(SettingService.class).getIssueSetting();
boolean ok = !setting.getStateSpecs().isEmpty();

Type guard

boolean hasIssueStates(GlobalIssueSetting s) { return !s.getStateSpecs().isEmpty(); }

Try / catch

try {
    var initial = setting.getInitialStateSpec();
} catch (ExplicitException e) {
    logger.error("Issue states not configured", e);
}

Prevention

When it happens

Trigger: Accessing getInitialStateSpec() (e.g. during issue creation, issue listing, or setting validation) when the global issue setting's state list is empty.

Common situations: Administrator cleared all states in Administration → Issue Settings; corrupted or manually edited settings DB rows; fresh/custom setups where default states were removed before any issue workflow is used.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


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