Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52322

Jenkins jacoco plugin fails to when running on slave machines

    Details

    • Similar Issues:

      Description

      Jenkins jacoco plugin fails to when running on slave machine:

      java.nio.file.AccessDeniedException: /omi/jenkins/jenkins_home/jobs/PSD2-dev-jacoco/builds/23/jacoco/sources/uk/co/ybs/ecom/ooba/authentify/AuthentifyException.java
      at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
      at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
      at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
      at java.nio.file.Files.newOutputStream(Files.java:216)
      at hudson.util.IOUtils.copy(IOUtils.java:42)
      at hudson.FilePath.readFromTar(FilePath.java:2363)
      Caused: java.io.IOException: Failed to extract /ybs/u001/sw/jenkins/jenkins_slave/workingdir/workspace/PSD2-dev-jacoco/yoa/moscow/ooba/java/*/.java
      at hudson.FilePath.readFromTar(FilePath.java:2373)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:2277)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:2180)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:2163)
      at hudson.plugins.jacoco.JacocoReportDir.saveSourcesFrom(JacocoReportDir.java:48)
      at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:609)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

       

      The file does exist on the Jenkins master, so it yhas obviously been pulled back/copied:

      ll /omi/jenkins/jenkins_home/jobs/PSD2-dev-jacoco/builds/23/jacoco/sources/uk/co/ybs/ecom/ooba/authentify/AuthentifyException.java

      rrr-. 1 oracle dba 635 Jun 29 15:58 /omi/jenkins/jenkins_home/jobs/PSD2-dev-jacoco/builds/23/jacoco/sources/uk/co/ybs/ecom/ooba/authentify/AuthentifyException.java

       

      As a workaround I can prevent the pluging from finding any source files, by changing 

      jacoco classPattern: 'builds/*/classes', execPattern: 'builds/jacoco//.exec', sourcePattern: 'yoa/*/java'

       

      to 

      jacoco classPattern: 'builds/*/classes', execPattern: 'builds/jacoco//*.exec', sourcePattern: ''

      surprisingly adding 

       

      , skipCopyOfSrcFiles: true

       

      does not fix the issue. Note that jacoco is running on a slave machine.

       

       

       

       

        Attachments

          Activity

          Hide
          lippo Patrick Rehder added a comment -

          I have a similar problem.

          Exception is:

          Caused: java.io.IOException: Failed to extract /.../source/.../src/null

          Reason:

          [JaCoCo plugin] Saving matched source directories for source-pattern: source/**/src:
          [JaCoCo plugin] Source Inclusions: null
          [JaCoCo plugin] Source Exclusions: null
          

          But Inclusions are defined in Job Config:

           

          Show
          lippo Patrick Rehder added a comment - I have a similar problem. Exception is: Caused: java.io.IOException: Failed to extract /.../source/.../src/null Reason: [JaCoCo plugin] Saving matched source directories for source-pattern: source/**/src: [JaCoCo plugin] Source Inclusions: null [JaCoCo plugin] Source Exclusions: null But Inclusions are defined in Job Config:  
          Hide
          prateek33 Prateek Gupta added a comment -

          I have the same problem. My job runs on the slave nodes and jacoco keeps failing with:
          AccessDeniedException

          I have to skip the sourceFile pattern as a workaround and this means no source file displaying the coverage.

          Show
          prateek33 Prateek Gupta added a comment - I have the same problem. My job runs on the slave nodes and jacoco keeps failing with: AccessDeniedException I have to skip the sourceFile pattern as a workaround and this means no source file displaying the coverage.

            People

            • Assignee:
              ognjenb Ognjen Bubalo
              Reporter:
              chris_ybs Chris Brooking
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: