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

Upgrade to version 1.600 broke GIT plugin

    XMLWordPrintable

Details

    Description

      After upgrading to version 1.6 I get the following error on every build.

      (I have also uninstalled and reinstalled both GIT plugins with no avail)

      FATAL: Null value not allowed as an environment variable: GIT_COMMIT
      java.lang.IllegalArgumentException: Null value not allowed as an environment variable: GIT_COMMIT
      at hudson.EnvVars.put(EnvVars.java:356)
      at hudson.EnvVars.put(EnvVars.java:74)
      at hudson.plugins.git.GitSCM.buildEnvVars(GitSCM.java:1151)
      at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1009)
      at hudson.scm.SCM.checkout(SCM.java:484)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
      at hudson.model.Run.execute(Run.java:1717)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      ERROR: Build step failed with exception
      java.lang.IllegalArgumentException: Null value not allowed as an environment variable: GIT_COMMIT
      at hudson.EnvVars.put(EnvVars.java:356)
      at hudson.EnvVars.put(EnvVars.java:74)
      at hudson.plugins.git.GitSCM.buildEnvVars(GitSCM.java:1151)
      at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
      at hudson.plugins.mstest.MSTestPublisher.resolveFilePath(MSTestPublisher.java:99)
      at hudson.plugins.mstest.MSTestPublisher.perform(MSTestPublisher.java:79)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      at hudson.model.Run.execute(Run.java:1742)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)

      Attachments

        Issue Links

          Activity

            danielbeck Daniel Beck added a comment -

            Would be interesting to know from which previous version you upgraded.

            danielbeck Daniel Beck added a comment - Would be interesting to know from which previous version you upgraded.
            dineenr Bobby Dineen added a comment -

            version 1.599

            dineenr Bobby Dineen added a comment - version 1.599
            markewaite Mark Waite added a comment - - edited

            I have the same problem on my Jenkins 1.580.3 installation at the office. The fix appears to be reasonably straightforward. It is unclear to me what changed that caused this to become visible now when it was previously not visible.

            markewaite Mark Waite added a comment - - edited I have the same problem on my Jenkins 1.580.3 installation at the office. The fix appears to be reasonably straightforward . It is unclear to me what changed that caused this to become visible now when it was previously not visible.
            pattersonc Chris Pattersonc added a comment - - edited

            Two workarounds that I have found

            1. Copy project (start with clean build history)

            2. Delete all build history from job directory (builds, lastStable, etc.)

            In comparing the resultant build.xml from an older build (pre 1.5) and new build (1.600), the sha has doesn't appear to be in the old build (or is in a different place in the xml doc).

            pattersonc Chris Pattersonc added a comment - - edited Two workarounds that I have found 1. Copy project (start with clean build history) 2. Delete all build history from job directory (builds, lastStable, etc.) In comparing the resultant build.xml from an older build (pre 1.5) and new build (1.600), the sha has doesn't appear to be in the old build (or is in a different place in the xml doc).

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/GitSCM.java
            http://jenkins-ci.org/commit/git-plugin/90a0d7c539feddad696cffcfc457799c82fd8769
            Log:
            [Fix JENKINS-27180] GIT_COMMIT env var not allowed with empty value

            Only place GIT_COMMIT into the environment if it has a non-empty
            value. An empty value in the environment is assumed to have no
            significant difference from a non-existing value.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/90a0d7c539feddad696cffcfc457799c82fd8769 Log: [Fix JENKINS-27180] GIT_COMMIT env var not allowed with empty value Only place GIT_COMMIT into the environment if it has a non-empty value. An empty value in the environment is assumed to have no significant difference from a non-existing value.
            markewaite Mark Waite added a comment -

            Fix should be included in the next release after git plugin 2.4.0.

            markewaite Mark Waite added a comment - Fix should be included in the next release after git plugin 2.4.0.
            markewaite Mark Waite added a comment -

            Included in git plugin 2.4.1 released 26 Dec 2015

            markewaite Mark Waite added a comment - Included in git plugin 2.4.1 released 26 Dec 2015

            People

              ndeloof Nicolas De Loof
              dineenr Bobby Dineen
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: