theonedev/onedev · error · NotFoundException

Markdown file not found (report:

Error message

Markdown file not found (report: 

What it means

The page's callable reads the markdown file from <buildDir>/markdown-reports/<reportName>/<filePath> and, when Java reports NoSuchFileException, translates it to NotFoundException("Markdown file not found (report: ..., path: ...)"). This means the resolved file does not exist on disk at the time of the request, even though the path passed the earlier traversal checks. Note it specifically catches NoSuchFileException; other I/O errors surface differently.

Source

Thrown at server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/MarkdownReportPage.java:126

		private final String reportName;
		
		private final String filePath;
		
		private GetMarkdownContent(Long projectId, Long buildNumber, String reportName, String filePath) {
			this.projectId = projectId;
			this.buildNumber = buildNumber;
			this.reportName = reportName;
			this.filePath = filePath;
		}
		
		@Override
		public String call() throws Exception {
			File file = new File(OneDev.getInstance(BuildService.class).getBuildDir(projectId, buildNumber),
					PublishMarkdownReportStep.CATEGORY + "/" + reportName + "/" + filePath);
			try {
				return FileUtils.readFileToString(file, StandardCharsets.UTF_8);
			} catch (NoSuchFileException e) {
				throw new NotFoundException("Markdown file not found (report: " + reportName + ", path: " + filePath + ")");
			}
		}
		
	}
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Verify the Publish Markdown Report step actually ran and published this path in that specific build.
  2. Check exact spelling and case of the file path in the URL.
  3. Re-run the build to regenerate the report files.
  4. If the build is old, confirm its artifacts were not cleaned by retention policies.

Example fix

// before
String path = "Docs/Readme.md"; // published file is docs/README.md

// after
String path = "docs/README.md";
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const content = fetchMarkdownReport(projectId, buildNumber, reportName, filePath);
} catch (e) {
  if (/Markdown file not found/.test(e.message)) {
    console.warn('File not published in build', buildNumber, '- re-run or fix path', filePath);
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Requesting a report page where the file was never published by the build, was deleted/cleaned up, or the file path differs in spelling/case from the published file.

Common situations: Old builds whose artifacts were pruned; report published with different casing on a case-sensitive filesystem; build step skipped or failed; links inside markdown pointing at files not included in the published report.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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