theonedev/onedev · error · NotAcceptableException

Issue management not enabled in this project

Error message

Issue management not enabled in this project

What it means

OneDev throws this when a user navigates to the NewIssuePage of a project that has issue management turned off. The page constructor checks getProject().isIssueManagement() before rendering and rejects access with a NotAcceptableException. It is an access/feature-gating guard, not a bug.

Source

Thrown at server-core/src/main/java/io/onedev/server/web/page/project/issues/create/NewIssuePage.java:50

import io.onedev.server.web.component.issue.workflowreconcile.WorkflowChangeAlertPanel;
import io.onedev.server.web.component.link.ViewStateAwarePageLink;
import io.onedev.server.web.page.project.ProjectPage;
import io.onedev.server.web.page.project.issues.detail.IssueActivitiesPage;
import io.onedev.server.web.page.project.issues.list.ProjectIssueListPage;
import io.onedev.server.web.page.project.overview.ProjectOverviewPage;
import io.onedev.server.web.page.security.LoginPage;

public class NewIssuePage extends ProjectPage implements InputContext {

	private static final String PARAM_TEMPLATE = "template";
	
	private IModel<Criteria<Issue>> templateModel;
	
	public NewIssuePage(PageParameters params) {
		super(params);
		
		if (!getProject().isIssueManagement())
			throw new NotAcceptableException(_T("Issue management not enabled in this project"));
		
		User currentUser = getLoginUser();
		if (currentUser == null)
			throw new RestartResponseAtInterceptPageException(LoginPage.class);
		
		String queryString = params.get(PARAM_TEMPLATE).toString();
		templateModel = new LoadableDetachableModel<Criteria<Issue>>() {

			@Override
			protected Criteria<Issue> load() {
				try {
					IssueQueryParseOption option = new IssueQueryParseOption().withCurrentUserCriteria(true);
					return IssueQuery.parse(getProject(), queryString, option, true).getCriteria();
				} catch (Exception e) {
					return null;
				}
			}
			

View on GitHub (pinned to d44925c47c)

Solutions

  1. Enable issue management in the project: Project -> Settings (or project sidebar) -> Issue Management -> turn it on.
  2. Navigate to the correct project that actually has issue management enabled.
  3. If embedding links programmatically, check project.isIssueManagement() before linking to the NewIssuePage.

Example fix

// before
response.sendRedirect(basePath + "/~issues/new?project=" + projectPath);
// after
if (project.isIssueManagement())
    response.sendRedirect(basePath + "/~issues/new?project=" + projectPath);
else
    throw new IllegalStateException("Project " + projectPath + " has issue management disabled");
Defensive patterns

Strategy: validation

Validate before calling

if (!project.isIssueManagement()) { throw new IllegalStateException("Issue management is disabled for project " + project.getPath()); }

Type guard

boolean canCreateIssue(Project p) { return p != null && p.isIssueManagement(); }

Prevention

When it happens

Trigger: Directly opening the new-issue URL (or following a bookmark/deep link to create an issue) in a project whose Issue Management setting is disabled; rendering an issue-creation link for a project where issues were later turned off.

Common situations: An admin disabled issue tracking for the project after users bookmarked issue URLs; a tool or script auto-generates issue-creation links for all projects regardless of settings; user pasted a link from another project into this one.

Related errors


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