Multibranch Pipeline job scan cannot remove files

不问归期 提交于 2020-07-07 20:54:55

问题


We are using Multibranch Pipeline job on Jenkins. It scans branches on master and if there are changes then build is triggered on one of the slaves. However, sometimes during the scan, we receive an exception:

java.io.IOException: Unable to delete '/var/lib/jenkins/jobs/sample.job.build/branches/feature-P.of17kqq8ojl6.-PFT-repo'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
    at hudson.Util.deleteRecursive(Util.java:352)
    at hudson.model.AbstractItem.performDelete(AbstractItem.java:691)
    at org.jenkinsci.plugins.workflow.job.WorkflowJob.performDelete(WorkflowJob.java:642)
    at hudson.model.AbstractItem.delete(AbstractItem.java:675)
    at hudson.model.Job.delete(Job.java:676)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:289)
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
    at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1022)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:421)

 Caused by: java.nio.file.FileSystemException:
 /var/lib/jenkins/jobs/sample.job.build/branches/feature-P.of17kqq8ojl6.-PFT-repo/builds/58/.nfs00000000000e9e0d000000ba:
 Device or resource busy    at
 sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
    at
 sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at
 sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at
 sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
    at
 sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
    at java.nio.file.Files.deleteIfExists(Files.java:1165)  at
 hudson.Util.tryOnceDeleteFile(Util.java:290)   at
 hudson.Util.tryOnceDeleteRecursive(Util.java:370)  at
 hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)  at
 hudson.Util.tryOnceDeleteRecursive(Util.java:369)  at
 hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)  at
 hudson.Util.tryOnceDeleteRecursive(Util.java:369)  at
 hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)  at
 hudson.Util.tryOnceDeleteRecursive(Util.java:369)  at
 hudson.Util.deleteRecursive(Util.java:347)

The only solution we have now is to restart master and remove files. Any ideas why it happens?

来源:https://stackoverflow.com/questions/48437602/multibranch-pipeline-job-scan-cannot-remove-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!