theonedev/onedev · error · NotFoundException

Revision/path not found: ${revision}

Error message

Revision/path not found: ${revision}

What it means

RevisionAndPath.parse splits a combined revision/path string and progressively tests prefixes as revisions; when no prefix resolves to a commit (or the string is empty), the whole input is rejected with this NotFound error carrying the revision.

Source

Thrown at server-core/src/main/java/io/onedev/server/util/RevisionAndPath.java:49

			if (i != 0)
				revisionBuilder.append("/");
			revisionBuilder.append(segments.get(i));
			if (project.getObjectId(revisionBuilder.toString(), false) != null) {
				revision = revisionBuilder.toString();
				StringBuilder pathBuilder = new StringBuilder();
				for (int j=i+1; j<segments.size(); j++) {
					if (j != i+1)
						pathBuilder.append("/");
					pathBuilder.append(segments.get(j));
				}
				if (pathBuilder.length() != 0) {
					path = pathBuilder.toString();
				}
				return new RevisionAndPath(revision, path);
			}
		}
		if (revisionBuilder.length() != 0) {
			throw new NotFoundException("Revision/path not found: " + revisionBuilder.toString());
		} else {
			revision = project.getDefaultBranch();
			if (revision != null && project.getTagRef(revision) != null)
				return new RevisionAndPath(GitUtils.branch2ref(revision), path);
			else
				return new RevisionAndPath(revision, path);				
		}
	}

	@Nullable
	public String getRevision() {
		return revision;
	}

	@Nullable
	public String getPath() {
		return path;
	}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the revision (commit hash, branch or tag) exists in the project repository.
  2. Separate revision and path explicitly instead of relying on prefix inference.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server-core/src/main/java/io/onedev/server/util/RevisionAndPath.java:49 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/275ee41a8b57ade7. Report an issue: GitHub.