ERROR: No build record found

My builds are failing randomly with the following error

Started by user manu
Running as manu
Obtained Jenkinsfile from git
[Pipeline] Start of Pipeline
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (deploy)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] End of Pipeline
ERROR: No build record dev#387 could be located.
Finished: FAILURE

Jenkins version: 2.349

Hello @manuvakery and welcome to this community :wave:

Does the user that runs the builds have “Job/Read” permission for the job?

Hi @poddingue. Yes, the user has “Job/Read” permission for the job. It erroring out randomly. Most of the times the build is going well.

1 Like

We do have the same problem. The most affected job is rather long and it also waits for interactive inputs on various occasions.

When “Discard old builds” is unchecked then the issue seems to go away. I’m not certain if it completely prevents the problem or just reduces the number of occurrences to a very few.