{"record":{"id":"aa61b81d004ae34d","repo":"theonedev/onedev","slug":"markdown-file-not-found-report","errorCode":null,"errorMessage":"Markdown file not found (report: ","messagePattern":"Markdown file not found \\(report: ","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/MarkdownReportPage.java","lineNumber":126,"sourceCode":"\t\tprivate final String reportName;\n\t\t\n\t\tprivate final String filePath;\n\t\t\n\t\tprivate GetMarkdownContent(Long projectId, Long buildNumber, String reportName, String filePath) {\n\t\t\tthis.projectId = projectId;\n\t\t\tthis.buildNumber = buildNumber;\n\t\t\tthis.reportName = reportName;\n\t\t\tthis.filePath = filePath;\n\t\t}\n\t\t\n\t\t@Override\n\t\tpublic String call() throws Exception {\n\t\t\tFile file = new File(OneDev.getInstance(BuildService.class).getBuildDir(projectId, buildNumber),\n\t\t\t\t\tPublishMarkdownReportStep.CATEGORY + \"/\" + reportName + \"/\" + filePath);\n\t\t\ttry {\n\t\t\t\treturn FileUtils.readFileToString(file, StandardCharsets.UTF_8);\n\t\t\t} catch (NoSuchFileException e) {\n\t\t\t\tthrow new NotFoundException(\"Markdown file not found (report: \" + reportName + \", path: \" + filePath + \")\");\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}\n","sourceCodeStart":108,"sourceCodeEnd":132,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/MarkdownReportPage.java#L108-L132","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the Publish Markdown Report step actually ran and published this path in that specific build.","Check exact spelling and case of the file path in the URL.","Re-run the build to regenerate the report files.","If the build is old, confirm its artifacts were not cleaned by retention policies."],"exampleFix":"// before\nString path = \"Docs/Readme.md\"; // published file is docs/README.md\n\n// after\nString path = \"docs/README.md\";","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const content = fetchMarkdownReport(projectId, buildNumber, reportName, filePath);\n} catch (e) {\n  if (/Markdown file not found/.test(e.message)) {\n    console.warn('File not published in build', buildNumber, '- re-run or fix path', filePath);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Confirm the publish step ran in that exact build.","Keep an index of published files and link from it.","Watch for retention policies deleting old build artifacts.","Match path spelling and case exactly."],"tags":["file-not-found","build-artifact","markdown-report"],"backgroundTag":"file-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}