{"record":{"id":"377251b3ffd383eb","repo":"theonedev/onedev","slug":"previous-successful-similar-build-not-found","errorCode":null,"errorMessage":"Previous successful similar build not found","messagePattern":"Previous successful similar build not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/ai/TodResource.java","lineNumber":997,"sourceCode":"    }\n    \n    @Path(\"/get-previous-successful-similar-build\")\n    @GET\n    public Map<String, Object> getPreviousSuccessfulSimilarBuild(\n                @QueryParam(\"currentProject\") @NotNull String currentProjectPath, \n                @QueryParam(\"reference\") @NotNull String buildReference) {\n        if (SecurityUtils.getUser() == null)\n            throw new UnauthenticatedException();\n\n        var currentProject = getProject(currentProjectPath);\n\n        var build = getBuild(currentProject, buildReference);\n                \n        var foundBuild = buildService.findPreviousSuccessfulSimilar(build);\n        if (foundBuild != null) \n            return BuildHelper.getDetail(currentProject, foundBuild);\n        else \n            throw new NotFoundException(\"Previous successful similar build not found\");\n    }\n\n    @Path(\"/get-pull-request\")\n    @GET\n    public Map<String, Object> getPullRequestDetail(\n                @QueryParam(\"currentProject\") @NotNull String currentProjectPath, \n                @QueryParam(\"reference\") @NotNull String pullRequestReference, \n                @QueryParam(\"forWrite\") Boolean forWrite) {\n        if (SecurityUtils.getUser() == null)\n            throw new UnauthenticatedException();\n\n        var currentProject = getProject(currentProjectPath);\n        var pullRequest = getPullRequest(currentProject, pullRequestReference);\n\n        if (forWrite != null && forWrite) {\n            if (pullRequest.getSourceProject() == null)\n                throw new NotAcceptableException(\"Pull request source project no longer exists\");\n","sourceCodeStart":979,"sourceCodeEnd":1015,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/ai/TodResource.java#L979-L1015","documentation":"get-previous-successful-similar-build found no earlier build in the project that both succeeded and matches the current build's relevant criteria (same job/branch context), so there is no baseline build to return.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:997 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the reference build is correct and that prior successful builds exist for this job/branch.","Handle the absence of a baseline gracefully instead of retrying."],"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"}