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

AccessDeniedException when copying VCS dir

    Details

    • Similar Issues:

      Description

      Some times LastChanges throws java.nio.file.AccessDeniedException at this line:

       vcsTargetDir = new FilePath(new File(workspaceTargetDir.getRemote() + "/.svn"));
       vcsDirFound.copyRecursiveTo("**/*", vcsTargetDir); //here is where the exception is raised
      

      It looks like it is related to slave, need to confirm that. Following is full stacktrace:

      java.nio.file.AccessDeniedException: /var/procergs/build-tools/jenkins/jobs/apm-pipeline/builds/34/.svn/all-wcprops
       	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:39)
       	at hudson.FilePath.readFromTar(FilePath.java:2307)
       Caused: java.io.IOException: Failed to extract /var/procergs/build-tools-2/workspace/apm-pipeline/.svn/**/*
       	at hudson.FilePath.readFromTar(FilePath.java:2317)
       	at hudson.FilePath.copyRecursiveTo(FilePath.java:2221)
       	at hudson.FilePath.copyRecursiveTo(FilePath.java:2124)
       	at hudson.FilePath.copyRecursiveTo(FilePath.java:2107)
       	at com.github.jenkins.lastchanges.LastChangesPublisher.perform(LastChangesPublisher.java:169)
       	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:260)
       	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)
      

      Environment:
      Jenkins 2.89.3
      LastChanges 2.6.1

        Attachments

          Activity

          Hide
          rmpestano Rafael Pestano added a comment -

          The issue happens when the plugin tries to copy vcsDir from slave to master workspace and the directory already exists. If the build runs on master the plugin can override vcsDir but when on slave it cannot. I've checked file permissions and they look ok.

          The solution is not to copy to master workspace if the directory already exists.

          This fix will come in *v2.6.2 *

          Show
          rmpestano Rafael Pestano added a comment - The issue happens when the plugin tries to copy vcsDir from slave to master workspace and the directory already exists. If the build runs on master the plugin can override vcsDir but when on slave it cannot. I've checked file permissions and they look ok. The solution is not to copy to master workspace if the directory already exists. This fix will come in *v2.6.2 *
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: rafael-pestano
          Path:
          src/main/java/com/github/jenkins/lastchanges/LastChangesBuildAction.java
          src/main/java/com/github/jenkins/lastchanges/LastChangesPublisher.java
          http://jenkins-ci.org/commit/last-changes-plugin/98787fdb1a775b1a81c8c0fff96c408d25e711d0
          Log:
          refs #JENKINS-50569

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rafael-pestano Path: src/main/java/com/github/jenkins/lastchanges/LastChangesBuildAction.java src/main/java/com/github/jenkins/lastchanges/LastChangesPublisher.java http://jenkins-ci.org/commit/last-changes-plugin/98787fdb1a775b1a81c8c0fff96c408d25e711d0 Log: refs # JENKINS-50569

            People

            • Assignee:
              rmpestano Rafael Pestano
              Reporter:
              rmpestano Rafael Pestano
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: