theonedev/onedev · error · ExplicitException
This build is not authorized to create tag '
Error message
This build is not authorized to create tag '
What it means
CreateTagStep.run checks build.canCreateTag against the job authorization setting; when the build's job authorization does not include the tag name pattern, tag creation is refused. The message names the requested tag.
Source
Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/CreateTagStep.java:102
return OneDev.getInstance(SessionService.class).call(() -> {
var build = OneDev.getInstance(BuildService.class).load(buildId);
PersonIdent taggerIdent = OneDev.getInstance(UserService.class).getSystem().asPerson();
Project project = build.getProject();
String tagName = getTagName();
if (!Repository.isValidRefName(GitUtils.tag2ref(tagName))) {
logger.error("Invalid tag name: " + tagName);
return new ServerStepResult(false);
}
if (build.canCreateTag(getAccessTokenSecret(), tagName)) {
RefFacade tagRef = project.getTagRef(tagName);
if (tagRef != null)
OneDev.getInstance(ProjectService.class).deleteTag(project, tagName);
OneDev.getInstance(GitService.class).createTag(project, tagName, build.getCommitHash(),
taggerIdent, getTagMessage(), false);
} else {
throw new ExplicitException("This build is not authorized to create tag '" + tagName + "'");
}
return new ServerStepResult(true);
});
}
}
View on GitHub (pinned to d44925c47c)
Solutions
- Add the tag name (or a matching pattern) to the job authorization setting 'Create Tag' in the build spec.
- Adjust the tag name so it matches an already-authorized pattern.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/CreateTagStep.java:102 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/731dda0434bfa18d.
Report an issue: GitHub.