Issue with maven jobs running on slaves (linux). The maven run completes successfully, but not sure why Jenkins tries to archive files from the maven project after maven run completes. This is where the Jenkins job fails when attempting to archive these project files as indicated by the stacktrace below. But when the same job runs on the master (linux), it builds just fine.

      Waiting for Jenkins to finish collecting data

      [JENKINS] Archiving /var/lib/jenkins/workspace/company-abc/test-project/pom.xml to com.companyabc/test-project/1.1.1/test-project-1.1.1.pom
      [JENKINS] Archiving /var/lib/jenkins/workspace/company-abc/test-project/target/test-project-1.1.1.jar to com.companyabc/test-project/1.1.1/test-project-1.1.1.jar
      channel stopped
      ERROR: Failed to parse POMs
      java.io.IOException: java.util.concurrent.ExecutionException: hudson.os.PosixException: native error calling stat: No such file or directory /var/lib/jenkins/workspace/company-abc/test-project/target/test-project-1.1.1.jar ENOENT
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:2016)
      	at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57)
      	at hudson.maven.MavenBuild$ProxyImpl.performArchiving(MavenBuild.java:471)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:835)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566)
      	at hudson.model.Run.execute(Run.java:1678)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Caused by: java.util.concurrent.ExecutionException: hudson.os.PosixException: native error calling stat: No such file or directory /var/lib/jenkins/workspace/company-abc/test-project/target/test-project-1.1.1.jar ENOENT
      	at hudson.remoting.Channel$3.adapt(Channel.java:755)
      	at hudson.remoting.Channel$3.adapt(Channel.java:750)
      	at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:2014)
      	... 8 more
      Caused by: hudson.os.PosixException: native error calling stat: No such file or directory /var/lib/jenkins/workspace/company-abc/test-project/target/test-project-1.1.1.jar ENOENT
      	at hudson.os.PosixAPI$1.error(PosixAPI.java:35)
      	at jnr.posix.LinuxPOSIX.stat(LinuxPOSIX.java:117)
      	at jnr.posix.CheckedPOSIX.stat(CheckedPOSIX.java:265)
      	at jnr.posix.LazyPOSIX.stat(LazyPOSIX.java:267)
      	at hudson.util.IOUtils.mode(IOUtils.java:125)
      	at hudson.util.io.TarArchiver.visit(TarArchiver.java:101)company-abc
      	at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
      	at hudson.FilePath$ExplicitlySpecifiedDirScanner.scan(FilePath.java:2540)
      	at hudson.FilePath.writeToTar(FilePath.java:2052)
      	at hudson.FilePath.access$1000(FilePath.java:172)
      	at hudson.FilePath$41.invoke(FilePath.java:1993)
      	at hudson.FilePath$41.invoke(FilePath.java:1989)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:679)
      

          [JENKINS-21426] ENOENT during archiving artifacts

          kai tea created issue -

          kai tea added a comment -

          I forgot to mention I am currently on the latest Jenkins: 1.547

          kai tea added a comment - I forgot to mention I am currently on the latest Jenkins: 1.547

          Andrew Bayer added a comment -

          Seeing this for one of our jobs on 1.532.2 as well.

          Andrew Bayer added a comment - Seeing this for one of our jobs on 1.532.2 as well.

          Andrew Bayer added a comment -

          So in at least the case I'm able to inspect right now, it looks like the file it's barfing on legitimately doesn't exist at this point - maybe we should be checking for file existence in hudson.FilePath$ExplicitlySpecifiedDirScanner.scan, in case the file existed when the file listing was done but no longer exists by this time?

          Andrew Bayer added a comment - So in at least the case I'm able to inspect right now, it looks like the file it's barfing on legitimately doesn't exist at this point - maybe we should be checking for file existence in hudson.FilePath$ExplicitlySpecifiedDirScanner.scan, in case the file existed when the file listing was done but no longer exists by this time?

          Andrew Bayer added a comment -

          Assigning to kohsuke for his thoughts - also pinging jglick to see if he has anything.

          Andrew Bayer added a comment - Assigning to kohsuke for his thoughts - also pinging jglick to see if he has anything.
          Andrew Bayer made changes -
          Assignee New: Kohsuke Kawaguchi [ kohsuke ]

          Ken Koster added a comment -

          This issue may come from the git plugin "Clean before checkout" feature. I was seeing this exact error with that setting turned on, with Jenkins 1.522 and Jenkins Git Plugin 2.2.1. Since turning off the cleaning setting, the ENOENT error hasn't come back (yet).

          Ken Koster added a comment - This issue may come from the git plugin "Clean before checkout" feature. I was seeing this exact error with that setting turned on, with Jenkins 1.522 and Jenkins Git Plugin 2.2.1. Since turning off the cleaning setting, the ENOENT error hasn't come back (yet).
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-20187 [ JENKINS-20187 ]
          Jesse Glick made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: master-slave [ 15489 ]
          Component/s Original: maven [ 16033 ]
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ]
          Summary Original: Jenkins Build Fails on Archiving New: ENOENT during archiving artifacts

          Ian Blue added a comment -

          Hi, has anybody found a solution for this issue? I am experiencing the same and couldn't find a working solution.

          Ian Blue added a comment - Hi, has anybody found a solution for this issue? I am experiencing the same and couldn't find a working solution.

            Unassigned Unassigned
            kaitea2005 kai tea
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: