theonedev/onedev · error · ExplicitException

Not a changed file:

Error message

Not a changed file: 

What it means

WorkspaceChangesPage.onInitialize resolves the file selected via the 'selectedFile' parameter among the workspace's changed/conflicted file entries. If findSelectedFileEntry cannot match it, it throws ExplicitException('Not a changed file: ' + selectedFile), because a diff can only be shown for files that actually changed in the workspace.

Source

Thrown at server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.java:140

		addRepositorySections(sidebar);

		diffContent = new WebMarkupContainer("diffContent");
		diffContent.setOutputMarkupPlaceholderTag(true);
		diffContent.setVisible(false);
		add(diffContent);

		diffContent.add(new Label("diffFileName", ""));
		diffContent.add(new WebMarkupContainer("diffPanel"));

		noSelection = new WebMarkupContainer("noSelection");
		noSelection.setOutputMarkupPlaceholderTag(true);
		add(noSelection);

		if (selectedFile != null) {
			RepositoryInfo repository = findSelectedRepository();
			FileEntry found = findSelectedFileEntry(repository);
			if (found == null)
				throw new ExplicitException("Not a changed file: " + selectedFile);
			selectedStaged = found.staged;
			selectedConflicted = found.conflicted;
			showDiffContent(repository, found);
		}
	}

	private void addRepositorySections(WebMarkupContainer container) {
		List<RepositoryInfo> repositories = repositoriesModel.getObject();
		container.add(new ListView<>("repositorySections", repositories) {

			@Override
			protected void populateItem(ListItem<RepositoryInfo> item) {
				if (repositories.size() == 1)
					item.add(AttributeAppender.append("class", " flex-grow-1 min-height-0"));
				RepositoryInfo repository = item.getModelObject();
				Label title = new Label("repositoryTitle",
						repository.path.isEmpty()
								? _T("Main Repository")

View on GitHub (pinned to d44925c47c)

Solutions

  1. Reload the workspace changes page without the selectedFile parameter and pick the file from the current change list.
  2. Verify the file still has pending (staged/unstaged) changes in the workspace.
  3. Commit or discard the file's changes if it should no longer appear as changed.
  4. Check the path matches the repository-relative path exactly (case-sensitive).
Defensive patterns

Strategy: validation

Validate before calling

FileEntry found = findSelectedFileEntry(repository);
if (found == null) { /* omit selection, show plain changes list */ }

Try / catch

try {
  showDiffContent(repository, found);
} catch (ExplicitException e) {
  // clear stale selectedFile param and re-render changes list
}

Prevention

When it happens

Trigger: Requesting WorkspaceChangesPage with a selectedFile path that is not among the workspace's changed entries — e.g. the file's changes were committed or reverted after the link was generated, the path is misspelled, or the file belongs to a different repository within the workspace.

Common situations: Stale link after committing/reverting workspace changes; selecting a file then switching workspace branch/state; hand-crafted URL with an arbitrary path.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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