{"record":{"id":"088433f862c81c15","repo":"theonedev/onedev","slug":"unable-to-find-specified-artifact-project-s-bu","errorCode":null,"errorMessage":"Unable to find specified artifact (project: %s, build number: %d, artifact path: %s)","messagePattern":"Unable to find specified artifact \\(project: (.+?), build number: (.+?), artifact path: (.+?)\\)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java","lineNumber":1201,"sourceCode":"\t\n\t@Override\n\tpublic void deleteArtifact(Build build, @Nullable String artifactPath) {\n\t\tLong projectId = build.getProject().getId();\n\t\tLong buildNumber = build.getNumber();\n\t\tprojectService.runOnActiveServer(projectId, () -> write(getArtifactsLockName(projectId, buildNumber), () -> {\n\t\t\tFile artifactsDir = getArtifactsDir(projectId, buildNumber);\n\t\t\tif (artifactPath != null) {\n\t\t\t\tFile artifactFile = new File(artifactsDir, artifactPath);\n\t\t\t\tif (artifactFile.exists()) {\n\t\t\t\t\tif (artifactFile.isFile())\n\t\t\t\t\t\tFileUtils.deleteFile(artifactFile);\n\t\t\t\t\telse \n\t\t\t\t\t\tFileUtils.deleteDir(artifactsDir);\n\t\t\t\t} else {\n\t\t\t\t\tString errorMessage = String.format(\n\t\t\t\t\t\t\t\"Unable to find specified artifact (project: %s, build number: %d, artifact path: %s)\",\n\t\t\t\t\t\t\tprojectId, buildNumber, artifactPath);\n\t\t\t\t\tthrow new ExplicitException(errorMessage);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tFileUtils.cleanDir(artifactsDir);\n\t\t\t}\n\t\t\tprojectService.directoryModified(projectId, artifactsDir);\n\t\t\treturn null;\n\t\t}));\n\t}\n\n\t@Override\n\tpublic void syncBuilds(Long projectId, String activeServer) {\n\t\tprojectService.syncDirectory(projectId, BUILDS_DIR, (suffix) -> {\n\t\t\tprojectService.syncDirectory(projectId, BUILDS_DIR + \"/\" + suffix, (buildNumberString) -> {\n\t\t\t\tvar buildNumber = valueOf(buildNumberString);\n\t\t\t\tvar buildPath = getProjectRelativeDirPath(buildNumber);\n\t\t\t\tprojectService.syncFile(projectId, buildPath + \"/\" + LOG_FILE, \n\t\t\t\t\t\tgetLogLockName(projectId, buildNumber), activeServer);\n\t\t\t\tif (clusterService.runOnServer(activeServer, () -> getArtifactsDir(projectId, buildNumber).exists())) {","sourceCodeStart":1183,"sourceCodeEnd":1219,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java#L1183-L1219","documentation":"deleteArtifact (and related artifact access in DefaultBuildService) resolves the artifact path under the build's artifacts directory and throws this formatted NotFound when no file or directory exists at that path; project, build number and path are interpolated.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java:1201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the artifact was published by the build (check the build's artifact listing).","Correct the artifact path, including whether it points to a file or directory."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}