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

Windows: Cannot change Maven custom tool installer due to slave file locking

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Duplicate
    • core
    • None

    Description

      Unable to update Maven Custom Tool on Windows slaves due to file lock on Maven process.

      Cause:

      18:53:36 Caused by: java.io.IOException (http://stacktrace.jenkins-ci.org/search?query=java.io.IOException) : remote file operation failed: C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix at hudson.remoting.Channel@2b1d2861:bld2k8-03: java.nio.file.FileSystemException: C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix\lib\maven-core-3.3.9.jar: The process cannot access the file because it is being used by another process.
      

      Full Output (job logs):

      Replaced:

      • JENKINS_HOME location with C:\JENKINS_HOME (windows)
      • Nexus URL with NEXUS_URL
      18:53:36 [JDK_8u91_JCEP] $ cmd /c call C:\JENKINS_HOME\tools\hudson.model.JDK\JDK_8u91_JCEP\hudson7143384717113035922.bat
      
      18:53:36 FATAL: Failed to install NEXUS_URL/nexus/content/repositories/ebu-tools/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-corefix-lockfix.zip (NEXUS_URL/nexus/content/repositories/ebu-tools/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-corefix-lockfix.zip) to C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix
      
      18:53:36 java.io.IOException (http://stacktrace.jenkins-ci.org/search?query=java.io.IOException) : Failed to install NEXUS_URL/nexus/content/repositories/ebu-tools/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-corefix-lockfix.zip (NEXUS_URL/nexus/content/repositories/ebu-tools/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-corefix-lockfix.zip) to C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix
      
      18:53:36 at hudson.FilePath.installIfNecessaryFrom(FilePath.java:832) (http://stacktrace.jenkins-ci.org/search/?query=hudson.FilePath.installIfNecessaryFrom&entity=method)
      
      18:53:36 at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:79) (http://stacktrace.jenkins-ci.org/search/?query=hudson.tools.ZipExtractionInstaller.performInstallation&entity=method)
      
      18:53:36 at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68) (http://stacktrace.jenkins-ci.org/search/?query=hudson.tools.InstallerTranslator.getToolHome&entity=method)
      
      18:53:36 at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108) (http://stacktrace.jenkins-ci.org/search/?query=hudson.tools.ToolLocationNodeProperty.getToolHome&entity=method)
      
      18:53:36 at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206) (http://stacktrace.jenkins-ci.org/search/?query=hudson.tools.ToolInstallation.translateFor&entity=method)
      
      18:53:36 at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:624) (http://stacktrace.jenkins-ci.org/search/?query=hudson.tasks.Maven$MavenInstallation.forNode&entity=method)
      
      18:53:36 at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:183) (http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild.getEnvironment&entity=method)
      
      18:53:36 at com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper.decorateLauncher(CustomToolInstallWrapper.java:155) (http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper.decorateLauncher&entity=method)
      
      18:53:36 at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:566) (http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher&entity=method)
      
      18:53:36 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492) (http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.run&entity=method)
      
      18:53:36 at hudson.model.Run.execute(Run.java:1738) (http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method)
      
      18:53:36 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) (http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild.run&entity=method)
      
      18:53:36 at hudson.model.ResourceController.execute(ResourceController.java:98) (http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method)
      
      18:53:36 at hudson.model.Executor.run(Executor.java:410) (http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method)
      
      18:53:36 Caused by: java.io.IOException (http://stacktrace.jenkins-ci.org/search?query=java.io.IOException) : remote file operation failed: C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix at hudson.remoting.Channel@2b1d2861:bld2k8-03: java.nio.file.FileSystemException: C:\JENKINS_HOME\tools\hudson.tasks.Maven_MavenInstallation\Maven3-3-3-lockfix\lib\maven-core-3.3.9.jar: The process cannot access the file because it is being used by another process.
      

      Is this an issue that Jenkins can work around, or is it a limitation of Windows file locking and / or Maven ?

      Thx.

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment - - edited

            MavenToolInstallation and MavenInstaller are the part of the Jenkins core, not Custom Tools Plugin.
            https://github.com/jenkinsci/jenkins/blob/2311ae8a5e7afd550b13909b4b1c4ae3338274dd/core/src/main/java/hudson/tasks/Maven.java

            oleg_nenashev Oleg Nenashev added a comment - - edited MavenToolInstallation and MavenInstaller are the part of the Jenkins core, not Custom Tools Plugin. https://github.com/jenkinsci/jenkins/blob/2311ae8a5e7afd550b13909b4b1c4ae3338274dd/core/src/main/java/hudson/tasks/Maven.java
            oleg_nenashev Oleg Nenashev added a comment -

            Owen legitimately mentioned that there is "com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper.decorateLauncher()" in the call. This call implements installation of tools on the master, which runs a as a part if the build step and require the environment. This behavior is compliant with Jenkins core API. The Custom Tool Plugin's behavior is correct.

            So the problem is with File locking. It may be self-locking of the installer or a conflict/bug somewhere. Or just an antivirus/whatever locking the file.

            owood I need the following info:
            1) File usage by processes stats. E.g. ProcessExcplorer can provide it
            2) If the file is locked by Jenkins itself, use http://file-leak-detector.kohsuke.org/ to triangulate the original lock cause

            oleg_nenashev Oleg Nenashev added a comment - Owen legitimately mentioned that there is "com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper.decorateLauncher()" in the call. This call implements installation of tools on the master, which runs a as a part if the build step and require the environment. This behavior is compliant with Jenkins core API. The Custom Tool Plugin's behavior is correct. So the problem is with File locking. It may be self-locking of the installer or a conflict/bug somewhere. Or just an antivirus/whatever locking the file. owood I need the following info: 1) File usage by processes stats. E.g. ProcessExcplorer can provide it 2) If the file is locked by Jenkins itself, use http://file-leak-detector.kohsuke.org/ to triangulate the original lock cause
            oleg_nenashev Oleg Nenashev added a comment -

            Ping

            oleg_nenashev Oleg Nenashev added a comment - Ping
            oleg_nenashev Oleg Nenashev added a comment -

            Closing as a duplicate of JENKINS-40621

            oleg_nenashev Oleg Nenashev added a comment - Closing as a duplicate of JENKINS-40621

            People

              oleg_nenashev Oleg Nenashev
              owood Owen Wood
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: