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

Tool installer runs multiple times with toolenv-plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • toolenv-plugin
    • None
    • Slave running on windows
      Tool Environment Plugin 1.1
      Jenkins 2.7.4

      When using the Tool Environment plugin, the environment variables get set before every build step (GOOD).
      However, the tool installer gets run before every build step (BAD). The installers should run only once per job.

          [JENKINS-40345] Tool installer runs multiple times with toolenv-plugin

          We have a similar issue with Jenkins 2.73.1 in production. Something runs before each step and generates a NPE:

          ERROR: Could not install MAVEN_3_3_3_HOME java.lang.NullPointerException
          	at hudson.plugins.toolenv.ToolEnvBuildWrapper$1.buildEnvVars(ToolEnvBuildWrapper.java:46)
          	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:887)
          	at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:225)
          	at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:216)
          	at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:208)
          	at se.diabol.jenkins.pipeline.token.TokenUtils.decode(TokenUtils.java:60)
          	at se.diabol.jenkins.pipeline.token.TokenUtils.decodedTemplate(TokenUtils.java:45)

          As much as we'd love to switch to something else (using the pipeline plugin for example), this is not an option for us - we have more than 15,000 jobs today in production and we're pushing them to a Jenkins V2 environment progressively.

          This exception is not blocking in the sense that the build carries on, but that's very annoying. The tool gets installed correctly.

          If I contribute with a PR, is there any chance it could reviewed and released?

          Thanks,

          Damien.

          Damien Coraboeuf added a comment - We have a similar issue with Jenkins 2.73.1 in production. Something runs before each step and generates a NPE: ERROR: Could not install MAVEN_3_3_3_HOME java.lang.NullPointerException at hudson.plugins.toolenv.ToolEnvBuildWrapper$1.buildEnvVars(ToolEnvBuildWrapper.java:46) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:887) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:225) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:216) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:208) at se.diabol.jenkins.pipeline.token.TokenUtils.decode(TokenUtils.java:60) at se.diabol.jenkins.pipeline.token.TokenUtils.decodedTemplate(TokenUtils.java:45) As much as we'd love to switch to something else (using the pipeline plugin for example), this is not an option for us - we have more than 15,000 jobs today in production and we're pushing them to a Jenkins V2 environment progressively. This exception is not blocking in the sense that the build carries on, but that's very annoying. The tool gets installed correctly. If I contribute with a PR, is there any chance it could reviewed and released? Thanks, Damien.

            Unassigned Unassigned
            vandyev Evan Van Dyke
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: