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

GitHub Commit Status Setter - Cannot retrieve Git metadata

    XMLWordPrintable

Details

    Description

      Upon upgrading a number of plugins on one of our Jenkins clusters, we observed that builds were failing with the following exceptions:

       

      ERROR: [GitHub Commit Status Setter] - Cannot retrieve Git metadata for the build, setting build result to UNSTABLE
      

       

      Rolling the `GitHub` plugin back from '1.29.3' to '1.29.2' removes the error and builds now function as expected. 

      Attachments

        Activity

          fatmcgav Gavin Williams created issue -
          meyerbro Felipe Lopes added a comment -

          +1 here...

          Downgrading the Github Plugin to 1.29.2 solved the issue here too...

          meyerbro Felipe Lopes added a comment - +1 here... Downgrading the Github Plugin to 1.29.2 solved the issue here too...

          +1
          org/jenkinsci/plugins/github/util/BuildDataHelper.java:59 it compare github repo name with jekins job name which is epic fail

          iceiceice Alexey Grigorov added a comment - +1 org/jenkinsci/plugins/github/util/BuildDataHelper.java:59 it compare github repo name with jekins job name which is epic fail
          c9s Yo-An Lin added a comment -

          Same here. the project should not be compared with the repo name because they might be different.

          c9s Yo-An Lin added a comment - Same here. the project should not be compared with the repo name because they might be different.
          c9s Yo-An Lin added a comment -

          still got the same result if I use ManuallyEnteredRepositorySource

          c9s Yo-An Lin added a comment - still got the same result if I use ManuallyEnteredRepositorySource

          Same issue here

          neckbeardprince Adam Stracener added a comment - Same issue here

          Same here! Error both when starting end finishing a build.

           

          ERROR: [GitHub Commit Status Setter] Failed to update commit state on GitHub. Ignoring exception [Cannot retrieve Git metadata for the build]

          I was using GitHub plugin v1.29.3 both before and after my upgrade when this started. Some of the plugin upgrades I had pending that after installing forced me to do a rollback:

          Git 3.9.1 -> 4.0.0rc

          Git client 2.7.3 -> 3.0.0rc

          GitHub API 1.92 -> 1.95

           

           

           

          anderssonjohan Johan Andersson added a comment - Same here! Error both when starting end finishing a build.   ERROR: [GitHub Commit Status Setter] Failed to update commit state on GitHub. Ignoring exception [Cannot retrieve Git metadata for the build] I was using GitHub plugin v1.29.3 both before and after my upgrade when this started. Some of the plugin upgrades I had pending that after installing forced me to do a rollback: Git 3.9.1 -> 4.0.0rc Git client 2.7.3 -> 3.0.0rc GitHub API 1.92 -> 1.95      
          jpstrydom JP Strydom added a comment - - edited

          We're experiencing the same issue but rolling back to GitHub 1.9.2 did not fix our issue. Everything worked fine before, but it suddenly stopped working today and I suspect a few updates caused the issue (I'm not sure which ones did unfortunately).

          Our JenkinsFile looks as follows:

          #!/usr/bin/env groovy 
          properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'ScannerJobProperty', doNotScan: false]])
          node {
              stage('JENKINS - Initialize') {
                  echo 'Initializing...'
                  def node = tool name: 'node-lts', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
                  env.PATH = "${node}/bin:${env.PATH}"
              }
           
              stage('JENKINS - Checkout') {
                  echo 'Getting out source code...'
                  checkout scm
              }
              
              customStage('JENKINS - Install Dependencies') {
                  echo 'Retrieving tooling versions...'
                  sh 'node --version'
                  sh 'npm --version'
                  sh 'yarn --version'
                  echo 'Installing node dependencies...'
                  sh 'yarn install'
              }
              
              customStage('JENKINS - Tests') {
                  echo 'Running tests...'
                  sh 'npm test'
              }
          }
          
          void customStage(String context, Closure closure) {
               stage(context);
               try {
                   setBuildStatus(context, "In progress...", "PENDING");
                   closure();
               } catch (Exception e) {
                   setBuildStatus(context, e.take(140), "FAILURE");
               }
               setBuildStatus(context, "Success", "SUCCESS");
          }
          
          void setBuildStatus(String context, String message, String state) {
               step([
                   $class: "GitHubCommitStatusSetter",
                   contextSource: [$class: "ManuallyEnteredCommitContextSource", context: context],
                   reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/REPO_URL"],
                   errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
                   statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
               ]);
          }
          

          I receive a "ERROR: [GitHub Commit Status Setter] - Cannot retrieve Git metadata for the build, setting build result to UNSTABLE" error message everytime the setBuildStatus method is called (i.e. at the end of every customStage).

          Any suggestions would be welcome. 
          Thanks!

          jpstrydom JP Strydom added a comment - - edited We're experiencing the same issue but rolling back to GitHub 1.9.2 did not fix our issue. Everything worked fine before, but it suddenly stopped working today and I suspect a few updates caused the issue (I'm not sure which ones did unfortunately). Our JenkinsFile looks as follows: #!/usr/bin/env groovy properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: ' ', daysToKeepStr: ' ', numToKeepStr: ' 5 ')), [$class: ' ScannerJobProperty', doNotScan: false ]]) node {     stage( 'JENKINS - Initialize' ) {         echo 'Initializing...'         def node = tool name: 'node-lts' , type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'         env.PATH = "${node}/bin:${env.PATH}"    }    stage( 'JENKINS - Checkout' ) {         echo 'Getting out source code...'         checkout scm    }         customStage( 'JENKINS - Install Dependencies' ) {         echo 'Retrieving tooling versions...'        sh 'node --version'         sh 'npm --version'        sh 'yarn --version'        echo 'Installing node dependencies...'        sh 'yarn install'    }         customStage( 'JENKINS - Tests' ) {        echo 'Running tests...'        sh 'npm test'     } } void customStage( String context, Closure closure) {     stage(context);     try {         setBuildStatus(context, "In progress..." , "PENDING" );         closure();     } catch (Exception e) {         setBuildStatus(context, e.take(140), "FAILURE" );     }     setBuildStatus(context, "Success" , "SUCCESS" ); } void setBuildStatus( String context, String message, String state) {     step([         $class: "GitHubCommitStatusSetter" ,         contextSource: [$class: "ManuallyEnteredCommitContextSource" , context: context],         reposSource: [$class: "ManuallyEnteredRepositorySource" , url: "https: //github.com/REPO_URL" ],         errorHandlers: [[$class: "ChangingBuildStatusErrorHandler" , result: "UNSTABLE" ]],         statusResultSource: [ $class: "ConditionalStatusResultSource" , results: [[$class: "AnyBuildResult" , message: message, state: state]] ]     ]); } I receive a " ERROR: [GitHub Commit Status Setter] - Cannot retrieve Git metadata for the build, setting build result to UNSTABLE " error message everytime the setBuildStatus  method is called (i.e. at the end of every customStage ). Any suggestions would be welcome.  Thanks!
          gabor_farkas Gabor Farkas added a comment -

          Are there any alternatives to using this status setter?

          gabor_farkas Gabor Farkas added a comment - Are there any alternatives to using this status setter?

          Downgrading versions of these plugins solved the issue:

          Git 4.0.0rc

          Git client 3.0.0rc

          ostov Oleksandr Stovbenko added a comment - Downgrading versions of these plugins solved the issue: Git 4.0.0rc Git client 3.0.0rc
          gabor_farkas Gabor Farkas added a comment -

          I couldn't downgrade due to some plugin interdependencies.

          But here's a solution with sh: https://gist.github.com/gabor-farkas/4d02c7b2afdc23addfc22a333bbb6cf6

          gabor_farkas Gabor Farkas added a comment - I couldn't downgrade due to some plugin interdependencies. But here's a solution with sh:  https://gist.github.com/gabor-farkas/4d02c7b2afdc23addfc22a333bbb6cf6

          I can confirm that the issue is resolved by downgrading 

          • Git 4.0.0rc 
          • Git client 3.0.0rc

           

          wouterdb Wouter De Borger added a comment - I can confirm that the issue is resolved by downgrading  Git 4.0.0rc  Git client 3.0.0rc  

          Same issue. Downgrading Git and Git client as explained in previous comments has solved the issue. Note that the 'Set GitHub commit status (universal)' is also affected.

          masterzen Brice Figureau added a comment - Same issue. Downgrading Git and Git client as explained in previous comments has solved the issue. Note that the 'Set GitHub commit status (universal)' is also affected.
          jbb1 Jeremy Baker added a comment -

          +1 for me, downgrading also helped for now.  

          jbb1 Jeremy Baker added a comment - +1 for me, downgrading also helped for now.  
          brockers brockers added a comment -

          +1  for me.  Downgrade isn't an option because of other dependancies.  Probably have 15 broken builds.  I assume the best fix for now is to disable the plugin.

          brockers brockers added a comment - +1  for me.  Downgrade isn't an option because of other dependancies.  Probably have 15 broken builds.  I assume the best fix for now is to disable the plugin.

          +1, downgrading also helped (for now).

          laurentheirendt Laurent Heirendt added a comment - +1, downgrading also helped (for now).

          Hi, as brockers we cannot downgrade because their are too much dependencies between plugins and it breaks our Jenkins setup.

          Is somebody planning to work on this issue soon ? For us this is very critical, we have 10th of builds which do not work since the update .

          bgaillard Baptiste Gaillard added a comment - Hi, as brockers we cannot downgrade because their are too much dependencies between plugins and it breaks our Jenkins setup. Is somebody planning to work on this issue soon ? For us this is very critical, we have 10th of builds which do not work since the update .
          ostov Oleksandr Stovbenko added a comment - - edited

          bgaillard & brockers

          Downgrade dependencies 1st. Then downgrade Git 4.0.0rc and Git client 3.0.0rc.

          After restart you will be able to upgrade everything back to latest versions - Git 3.9.3 and Git client 2.7.6 (rc are versions not available anymore).

           

          ostov Oleksandr Stovbenko added a comment - - edited bgaillard & brockers Downgrade dependencies 1st. Then downgrade Git 4.0.0rc and Git client 3.0.0rc. After restart you will be able to upgrade everything back to latest versions - Git 3.9.3 and Git client 2.7.6 (rc are versions not available anymore).  

          ostov thanks for the suggestions, I already tried this few months ago without success.

          Today I tried to update the https://github.com/jenkinsci/github-plugin to find the problem and fix it.

          It seems that the problem came from the fact that the https://github.com/jenkinsci/git-plugin replaced the BuildData class by the BuildDetails class (this is explained here https://github.com/jenkinsci/git-plugin/commit/07cfa5ddef698838b01d4214915f98d4e902c0f8#diff-6cb4dc50342af417dc66c68b45c48fb1).

          As a result when Jenkins run a job the Github plugin failed to get the last build (to then retrieve the revision SHA1). 

          For now I just implemented VERY UGLY updates (i'll take the time to propose a clean PR later), the repo is here https://github.com/bgaillard/github-plugin.

          If you would like to test it compile it with mvn install -Dmaven.test.skip=true (I did not took time to fix the tests).

          bgaillard Baptiste Gaillard added a comment - ostov thanks for the suggestions, I already tried this few months ago without success. Today I tried to update the  https://github.com/jenkinsci/github-plugin  to find the problem and fix it. It seems that the problem came from the fact that the  https://github.com/jenkinsci/git-plugin  replaced the BuildData class by the BuildDetails class (this is explained here https://github.com/jenkinsci/git-plugin/commit/07cfa5ddef698838b01d4214915f98d4e902c0f8#diff-6cb4dc50342af417dc66c68b45c48fb1 ). As a result when Jenkins run a job the Github plugin failed to get the last build (to then retrieve the revision SHA1).  For now I just implemented VERY UGLY updates (i'll take the time to propose a clean PR later), the repo is here  https://github.com/bgaillard/github-plugin . If you would like to test it compile it with mvn install -Dmaven.test.skip=true (I did not took time to fix the tests).

          For those who do not want to compile the project from my fork you can find the HPI file here https://github.com/bgaillard/github-plugin/releases/tag/v1.30.0-alpha-1 and install it manually in Jenkins.

          Hope this helps.

          bgaillard Baptiste Gaillard added a comment - For those who do not want to compile the project from my fork you can find the HPI file here  https://github.com/bgaillard/github-plugin/releases/tag/v1.30.0-alpha-1  and install it manually in Jenkins. Hope this helps.
          bgaillard Baptiste Gaillard added a comment - - edited

          Hi, I created a PR on the github plugin project here https://github.com/jenkinsci/github-plugin/pull/216. Hope this one will be reviewed and accepted quickly

          bgaillard Baptiste Gaillard added a comment - - edited Hi, I created a PR on the github plugin project here  https://github.com/jenkinsci/github-plugin/pull/216 . Hope this one will be reviewed and accepted quickly

          bgaillard Thank you! However, this ticket is missing a stack trace for accuracy. The PR you submitted does not match our current install while we do have the same/similar issue.

          As I wrote in the PR thread: we're encountering the same issue symptom with lower plugin versions (see https://jira.nuxeo.com/browse/NXBT-2867).
          Our current versions are:

          • CloudBees Jenkins Enterprise 2.164.3.2-rolling
          • Git client plugin 2.7.6
          • Git plugin 3.9.3
          • SCM API Plugin 2.4.0

          What is your stacktrace and reproduction case please? Is it the same?

            java.io.IOException: Cannot retrieve Git metadata for the build
            	at org.jenkinsci.plugins.github.util.BuildDataHelper.getCommitSHA1(BuildDataHelper.java:87)
            	at org.jenkinsci.plugins.github.status.sources.BuildDataRevisionShaSource.get(BuildDataRevisionShaSource.java:32)
            	at org.jenkinsci.plugins.github.status.GitHubCommitStatusSetter.perform(GitHubCommitStatusSetter.java:135)
            Caused: org.jenkinsci.plugins.github.common.CombineErrorHandler$ErrorHandlingException
            	at org.jenkinsci.plugins.github.common.CombineErrorHandler.handle(CombineErrorHandler.java:74)
            	at org.jenkinsci.plugins.github.status.GitHubCommitStatusSetter.perform(GitHubCommitStatusSetter.java:164)
            	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.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
            	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)

          when running

              step([$class: 'GitHubCommitStatusSetter', reposSource: [$class: 'ManuallyEnteredRepositorySource', url: repos_url],
                  contextSource: [$class: 'ManuallyEnteredCommitContextSource', context: '...'],
                  statusResultSource: [$class: 'ConditionalStatusResultSource',
                      results: [[$class: 'AnyBuildResult', message: status_msg.get(status), state: status]]]]) 
          jcarsique Julien Carsique added a comment - bgaillard Thank you! However, this ticket is missing a stack trace for accuracy. The PR you submitted does not match our current install while we do have the same/similar issue. As I wrote in the PR thread: we're encountering the same issue symptom with lower plugin versions (see https://jira.nuxeo.com/browse/NXBT-2867 ). Our current versions are: CloudBees Jenkins Enterprise 2.164.3.2-rolling Git client plugin 2.7.6 Git plugin 3.9.3 SCM API Plugin 2.4.0 What is your stacktrace and reproduction case please? Is it the same? java.io.IOException: Cannot retrieve Git metadata for the build at org.jenkinsci.plugins.github.util.BuildDataHelper.getCommitSHA1(BuildDataHelper.java:87) at org.jenkinsci.plugins.github.status.sources.BuildDataRevisionShaSource.get(BuildDataRevisionShaSource.java:32) at org.jenkinsci.plugins.github.status.GitHubCommitStatusSetter.perform(GitHubCommitStatusSetter.java:135) Caused: org.jenkinsci.plugins.github.common.CombineErrorHandler$ErrorHandlingException at org.jenkinsci.plugins.github.common.CombineErrorHandler.handle(CombineErrorHandler.java:74) at org.jenkinsci.plugins.github.status.GitHubCommitStatusSetter.perform(GitHubCommitStatusSetter.java:164) 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.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) 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) when running step([$class: 'GitHubCommitStatusSetter' , reposSource: [$class: 'ManuallyEnteredRepositorySource' , url: repos_url], contextSource: [$class: 'ManuallyEnteredCommitContextSource' , context: '...' ], statusResultSource: [$class: 'ConditionalStatusResultSource' , results: [[$class: 'AnyBuildResult' , message: status_msg.get(status), state: status]]]])
          bgaillard Baptiste Gaillard added a comment - - edited

           Hi jcarsique, no need to provide a Stack Trace in my case.

          I explained the problem in my previous comment, in our case the problem is caused by the version 4.0.x of the Jenkins git-plugin. 

          It seems that your Exception is thown at the same place than our, in our case at line L78] the method returns an empty list.

          As a result at L82] the buildData returned is null and then at L87] an IOException is thrown.

          The problem in our case is that the git-plugin does not create BuildData objects since version 4.0.x, instead it creates instances of class BuildDetails. So using build.getActions(BuildData.class) does not work, I used build.getActions(BuildDetails.class) instead at L78] and adapted the code in consequence to fix the problem.

          I think you can try to debug the problem as I did. What your can do is to update the Github Plugin by adding a logger and logging the class names of the actions you'll receive when calling https://javadoc.jenkins-ci.org/hudson/model/Actionable.html#getActions-- at the beginning of the getCommitSHA1 function.

          Their are chances you have an Action describing your build which is not of same class as the BuildData class and that's why its not working as expected.

          Let me know if you tried to fix the problem and what is the class name of your action in your case. 

          Hope this helps

          bgaillard Baptiste Gaillard added a comment - - edited  Hi jcarsique , no need to provide a Stack Trace in my case. I explained the problem in my previous comment, in our case the problem is caused by the version 4.0.x  of the Jenkins git-plugin.  It seems that your Exception is thown at the same place than our, in our case at line L78 ] the method returns an empty list. As a result at L82 ] the buildData  returned is null  and then at L87 ] an IOException  is thrown. The problem in our case is that the git-plugin does not create BuildData  objects since version 4.0.x , instead it creates instances of class BuildDetails . So using build.getActions(BuildData.class)  does not work, I used build.getActions(BuildDetails.class)  instead at  L78 ] and adapted the code in consequence to fix the problem. I think you can try to debug the problem as I did. What your can do is to update the Github Plugin by adding a logger and logging the class names of the actions you'll receive when calling https://javadoc.jenkins-ci.org/hudson/model/Actionable.html#getActions--  at the beginning of the getCommitSHA1  function. Their are chances you have an Action  describing your build which is not of same class as the BuildData  class and that's why its not working as expected. Let me know if you tried to fix the problem and what is the class name of your action in your case.  Hope this helps
          markewaite Mark Waite added a comment -

          Git plugin 4.0.0rc was mistakenly released to the Jenkins update center when it was expected to only be released to the Jenkins experimental update center. Git plugin 4.0.0-beta10 and git plugin 4.0.0-beta11 both include the BuildDetails capability that had been removed from Git plugin 4.0.0rc. Refer to JENKINS-19022 for the reasons it would be desirable to remove BuildData from the plugin.

          When git plugin 4.0.0 officially releases, it will include BuildData. The attempt to remove BuildData was unsuccessful during the pre-release phase of git plugin 4.0.0, so it has been reinstated into the git plugin.

          markewaite Mark Waite added a comment - Git plugin 4.0.0rc was mistakenly released to the Jenkins update center when it was expected to only be released to the Jenkins experimental update center. Git plugin 4.0.0-beta10 and git plugin 4.0.0-beta11 both include the BuildDetails capability that had been removed from Git plugin 4.0.0rc. Refer to JENKINS-19022 for the reasons it would be desirable to remove BuildData from the plugin. When git plugin 4.0.0 officially releases, it will include BuildData. The attempt to remove BuildData was unsuccessful during the pre-release phase of git plugin 4.0.0, so it has been reinstated into the git plugin.
          alanthedev Alan Lee added a comment -

          Could someone summarize the latest status of this issue?

          I'm looking for a solution that does not require downgrading any of the plugins.

          alanthedev Alan Lee added a comment - Could someone summarize the latest status of this issue? I'm looking for a solution that does not require downgrading any of the plugins.
          markewaite Mark Waite added a comment -

          alanthedev the latest release of the GitHub plugin (1.29.3) depends on git plugin 3.4.0 or newer. The GitHub plugin expects the git plugin to write BuildData.

          All releases of git plugin 3.x write BuildData. Git plugin 4.0.0-beta10 (pre-release delivered July 5, 2019) and git plugin 4.0.0-beta11 (pre-release delivered Sep 13, 2019) write BuildData.

          Git plugin 4.0.0-rc (pre-release delivered Jan 30, 2019) does not write BuildData. Git plugin 4.0.0-rc was a failed attempt to resolve the memory bloat caused by the git plugin (JENKINS-19022). The attempt introduced too many incompatibilities and had to be reverted. My sincere apologies that I released git plugin 4.0.0-rc. The poor choice of version string caused it to appear in the Jenkins update center rather than in the Jenkins experimental update center.

          If you are running git plugin 4.0.0-rc and cannot downgrade, then I assume that means some plugin in your installation has declared a dependency on git plugin 4.0.0-rc. That plugin needs to be updated to not depend on git plugin 4.0.0-rc. The BuildData related changes in git plugin 4.0.0-rc are not included in git plugin 4.0.0-beta10 and are not included in git plugin 4.0.0-beta11 and will not be included in the final release of git plugin 4.0.0. The git plugin 4.0.0-rc release was a terrible mistake that I made which delivered pre-release code to the production Jenkins update center. The git plugin 4.0.0-rc release was also the clear proof that the API changes proposed in git plugin 4.0.0 pre-releases introduced too much incompatibility for other plugins that use the BuildData provided by the git plugin.

          If you cannot downgrade because an installed plugin has an explicit dependency on 4.0.0-rc, then you should still be able to upgrade to git plugin 4.0.0-beta11 from the experimental upgrade center. However, if one of your installed plugins truly has a dependency on git plugin 4.0.0-rc, it seems likely that the reason it depends on git plugin 4.0.0-rc is because it is using the API changes that were included in git plugin 4.0.0-rc. Those API changes are not available in newer pre-releases of git plugin 4.0.0 like git plugin 4.0.0-beta10 and git plugin 4.0.0-beta11.

          In summary, if you cannot downgrade because one of your plugins explicitly depends on git plugin 4.0.0-rc, then that plugin must be changed to not depend on git plugin 4.0.0-rc. If you cannot downgrade for some other reason, then you can likely upgrade to git client plugin 3.0.0-beta11 and git plugin 4.0.0-beta11.

          markewaite Mark Waite added a comment - alanthedev the latest release of the GitHub plugin (1.29.3) depends on git plugin 3.4.0 or newer . The GitHub plugin expects the git plugin to write BuildData . All releases of git plugin 3.x write BuildData. Git plugin 4.0.0-beta10 (pre-release delivered July 5, 2019) and git plugin 4.0.0-beta11 (pre-release delivered Sep 13, 2019) write BuildData. Git plugin 4.0.0-rc (pre-release delivered Jan 30, 2019) does not write BuildData. Git plugin 4.0.0-rc was a failed attempt to resolve the memory bloat caused by the git plugin ( JENKINS-19022 ). The attempt introduced too many incompatibilities and had to be reverted. My sincere apologies that I released git plugin 4.0.0-rc. The poor choice of version string caused it to appear in the Jenkins update center rather than in the Jenkins experimental update center. If you are running git plugin 4.0.0-rc and cannot downgrade, then I assume that means some plugin in your installation has declared a dependency on git plugin 4.0.0-rc. That plugin needs to be updated to not depend on git plugin 4.0.0-rc. The BuildData related changes in git plugin 4.0.0-rc are not included in git plugin 4.0.0-beta10 and are not included in git plugin 4.0.0-beta11 and will not be included in the final release of git plugin 4.0.0. The git plugin 4.0.0-rc release was a terrible mistake that I made which delivered pre-release code to the production Jenkins update center. The git plugin 4.0.0-rc release was also the clear proof that the API changes proposed in git plugin 4.0.0 pre-releases introduced too much incompatibility for other plugins that use the BuildData provided by the git plugin. If you cannot downgrade because an installed plugin has an explicit dependency on 4.0.0-rc, then you should still be able to upgrade to git plugin 4.0.0-beta11 from the experimental upgrade center. However, if one of your installed plugins truly has a dependency on git plugin 4.0.0-rc, it seems likely that the reason it depends on git plugin 4.0.0-rc is because it is using the API changes that were included in git plugin 4.0.0-rc. Those API changes are not available in newer pre-releases of git plugin 4.0.0 like git plugin 4.0.0-beta10 and git plugin 4.0.0-beta11. In summary, if you cannot downgrade because one of your plugins explicitly depends on git plugin 4.0.0-rc, then that plugin must be changed to not depend on git plugin 4.0.0-rc. If you cannot downgrade for some other reason, then you can likely upgrade to git client plugin 3.0.0-beta11 and git plugin 4.0.0-beta11.
          alanthedev Alan Lee added a comment -

          markewaite Thanks for a comprehensive summary of the issue. I think what I need is the last paragraph. Will try it out.

          alanthedev Alan Lee added a comment - markewaite Thanks for a comprehensive summary of the issue. I think what I need is the last paragraph. Will try it out.
          markewaite Mark Waite added a comment -

          If you have a publicly available plugin that explicitly depends on git plugin 4.0.0-rc (and not on earlier released versions), then the plugin maintainer needs to be notified that 4.0.0-rc is a dead and removed release.

          markewaite Mark Waite added a comment - If you have a publicly available plugin that explicitly depends on git plugin 4.0.0-rc (and not on earlier released versions), then the plugin maintainer needs to be notified that 4.0.0-rc is a dead and removed release.

          Hi, with the release of Git plugin 4.0.0 it appears to work now (and no more Jenkins crashes after downgrading plugins).

          Here are the steps i followed to fix the problem.

          1. Upgrade Jenkins master to the last version (we use the Blue Ocean Docker container in version 1.21.0)
          2. Execute the following in Manage Jenkins -> Script Console, this allows to identify the Jenkins plugins which depend on version 4.0.0-rc of Git Plugin
             def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
            plugins.each {
                println "${it.getShortName()} (${it.getVersion()}) => ${it.getDependencies()}\n"
            }
          3. {{}}Downgrade the plugins with a dependency to Git Plugin 4.0.0-rc
          4. Upgrade Git Plugin to version 4.0.0 and the other plugins which depend on it (most probably those found in step 3.)

          Hope this helps.

          bgaillard Baptiste Gaillard added a comment - Hi, with the release of Git plugin 4.0.0 it appears to work now (and no more Jenkins crashes after downgrading plugins). Here are the steps i followed to fix the problem. Upgrade Jenkins master to the last version (we use the Blue Ocean Docker container in version 1.21.0) Execute the following in Manage Jenkins -> Script Console, this allows to identify the Jenkins plugins which depend on version 4.0.0-rc of Git Plugin   def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {     println "${it.getShortName()} (${it.getVersion()}) => ${it.getDependencies()}\n" } {{}}Downgrade the plugins with a dependency to Git Plugin 4.0.0-rc Upgrade Git Plugin to version 4.0.0 and the other plugins which depend on it (most probably those found in step 3.) Hope this helps.
          markewaite Mark Waite added a comment -

          Resolved regression in git plugin 4.0.0-rc by releasing git plugin 4.0.0

          markewaite Mark Waite added a comment - Resolved regression in git plugin 4.0.0-rc by releasing git plugin 4.0.0
          markewaite Mark Waite made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            lanwen Kirill Merkushev
            fatmcgav Gavin Williams
            Votes:
            19 Vote for this issue
            Watchers:
            34 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: