theonedev/onedev · error · NotAcceptableException
Time tracking needs to be enabled for the project
Error message
Time tracking needs to be enabled for the project
What it means
Even with an active subscription, setting "ownEstimatedTime" fails with NotAcceptableException("Time tracking needs to be enabled for the project") when issue.getProject().isTimeTracking() is false. Each project must opt in to time tracking before estimated-time values can be changed.
Source
Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:626
if (data.containsKey("description")) {
if (!SecurityUtils.canModifyIssue(subject, issue))
throw new UnauthorizedException("No permission to update issue description");
issueChangeService.changeDescription(user, issue, (String) data.remove("description"));
}
var confidential = (Boolean) data.remove("confidential");
if (confidential != null) {
if (!SecurityUtils.canModifyIssue(subject, issue))
throw new UnauthorizedException("No permission to update issue confidential");
issueChangeService.changeConfidential(user, issue, confidential);
}
Integer ownEstimatedTime = (Integer) data.remove("ownEstimatedTime");
if (ownEstimatedTime != null) {
if (!subscriptionService.isSubscriptionActive())
throw new NotAcceptableException("An active subscription is required for this feature");
if (!issue.getProject().isTimeTracking())
throw new NotAcceptableException("Time tracking needs to be enabled for the project");
if (!SecurityUtils.canScheduleIssues(subject, issue.getProject()))
throw new UnauthorizedException("Issue schedule permission required to set own estimated time");
issueChangeService.changeOwnEstimatedTime(user, issue, ownEstimatedTime*60);
}
@SuppressWarnings("unchecked")
List<String> iterationNames = (List<String>) data.remove("iterations");
if (iterationNames != null) {
if (!SecurityUtils.canScheduleIssues(subject, issue.getProject()))
throw new UnauthorizedException("Issue schedule permission required to set iterations");
var iterations = new ArrayList<Iteration>();
for (var iterationName : iterationNames) {
var iteration = iterationService.findInHierarchy(issue.getProject(), iterationName);
if (iteration == null)
throw new NotFoundException("Iteration '" + iterationName + "' not found");
iterations.add(iteration);
}
issueChangeService.changeIterations(user, issue, iterations);View on GitHub (pinned to d44925c47c)
Solutions
- Enable Time Tracking for the project: Project > Preferences/Settings > enable time tracking.
- Remove "ownEstimatedTime" from the payload for projects where tracking is intentionally off.
- Batch-enable time tracking across projects if tooling targets many projects.
- Check the error ordering: fix this before asserting schedule permissions, as the subscription check precedes it.
Example fix
// before
// project "proj" has time tracking disabled
editIssue("proj", ref, {ownEstimatedTime: 4}) // 406
// after
// Project Settings -> enable Time Tracking, then:
editIssue("proj", ref, {ownEstimatedTime: 4}) Defensive patterns
Strategy: validation
Validate before calling
// ensure the target project has time tracking enabled
const project = await getProject(projectPath);
if ('ownEstimatedTime' in payload && !project.timeTracking) {
delete payload.ownEstimatedTime;
throw new Error(`Enable Time Tracking on project '${projectPath}' first`);
} Try / catch
try { await editIssue(projectPath, ref, {ownEstimatedTime}); } catch (e) { if (e.status === 406 && /time tracking/i.test(e.message)) { await enableProjectTimeTracking(projectPath); return retry(); } throw e; } Prevention
- Enable Time Tracking in each project's settings before estimating hours
- Enumerate target projects and validate the flag before bulk updates
- Include time-tracking state in preflight checks of automation tooling
- Standardize project templates with time tracking on for teams using estimates
When it happens
Trigger: POST /edit-issue with "ownEstimatedTime" on a project whose Time Tracking setting is disabled, while the server subscription is active.
Common situations: New projects created without enabling time tracking; AI agents configured globally but used against projects with default settings; migrated projects missing the setting.
Related errors
- An active subscription is required for this feature
- Package management not enabled for project '${projectPath}'
- Package management not enabled for project '${project.getPat
- Unrecognized command:
- Unable to discover cluster ip from database connection url:
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/e3fcd94555dbf38d.
Report an issue: GitHub.