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

Builds are failing due to GitHubCommitNotifier exception

    XMLWordPrintable

Details

    Description

      GitHubCommitNotifier is throwing a (very helpful) exception which causes the build to fail. This started this morning without things being changed on our end.

      At first I thought it was due to the upgrade to 1.570 but even after downgrading to 1.569 it did not resolve the issue.

      The exception that is being thrown in the console is:

      15:09:57 Publishing Clover coverage report...
      15:09:57 Publishing Clover XML report...
      15:09:57 Publishing Clover coverage results...
      15:09:57 Recording test results
      15:09:58 ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception
      15:09:58 java.lang.NullPointerException
      15:09:58 at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:53)
      15:09:58 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      15:09:58 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
      15:09:58 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
      15:09:58 at hudson.model.Build$BuildExecution.post2(Build.java:183)
      15:09:58 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
      15:09:58 at hudson.model.Run.execute(Run.java:1757)
      15:09:58 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      15:09:58 at hudson.model.ResourceController.execute(ResourceController.java:88)
      15:09:58 at hudson.model.Executor.run(Executor.java:234)

      Attachments

        Issue Links

          Activity

            frank Frank K added a comment -

            Any clues why this is happening janinko valdisrigdon?

            frank Frank K added a comment - Any clues why this is happening janinko valdisrigdon ?
            davidtanner David Tanner added a comment -

            This doesn't appear to be an issue with ghprb. Is there any more to the stack trace?

            davidtanner David Tanner added a comment - This doesn't appear to be an issue with ghprb. Is there any more to the stack trace?
            jmoody Joshua Moody added a comment -

            I am seeing this as well.

            jenkins 1.575, 1.574

            ghprb - 1.13, 1.13-1
            GitHub Plugin - 1.9, 1.9.1
            GitHub API plugin - 1.56

            RE: more logs - I see the same logs as Frank K.

            jmoody Joshua Moody added a comment - I am seeing this as well. jenkins 1.575, 1.574 ghprb - 1.13, 1.13-1 GitHub Plugin - 1.9, 1.9.1 GitHub API plugin - 1.56 RE: more logs - I see the same logs as Frank K.
            davidtanner David Tanner added a comment -

            This is something happening in the github plugin. Is it only happening when there isn't a previous build?

            https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java

            Bar.java
                @Override
                public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
            
                    BuildData buildData = build.getAction(BuildData.class);
                    String sha1 = ObjectId.toString(buildData.getLastBuiltRevision().getSha1());
            
            davidtanner David Tanner added a comment - This is something happening in the github plugin. Is it only happening when there isn't a previous build? https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java Bar.java @Override public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { BuildData buildData = build.getAction(BuildData.class); String sha1 = ObjectId.toString(buildData.getLastBuiltRevision().getSha1());
            jmoody Joshua Moody added a comment -

            re: previous build

            Interesting.

            I had to blow away my workspace for a completely unrelated reason.

            Every build since has failed (b/c a vagrant box cannot be provisioned) and ended with the NPE describe above.

            Despite having several (failing) runs, I always see: "First time build. Skipping changelog." after the pull from GitHub.

            So, maybe it is only happening when there isn't a previous build.

            I will push on this a little harder later today.

            jmoody Joshua Moody added a comment - re: previous build Interesting. I had to blow away my workspace for a completely unrelated reason. Every build since has failed (b/c a vagrant box cannot be provisioned) and ended with the NPE describe above. Despite having several (failing) runs, I always see: "First time build. Skipping changelog." after the pull from GitHub. So, maybe it is only happening when there isn't a previous build. I will push on this a little harder later today.
            jmoody Joshua Moody added a comment - - edited

            Yes. It appears that this is only happening if there is no last built revision.

            The blame for that line is back in 2012-10-22 - http://git.io/mq-TlA

            I will look up stream to see why there is no last built revision; for this job, it looks like there should be one.

            jmoody Joshua Moody added a comment - - edited Yes. It appears that this is only happening if there is no last built revision. The blame for that line is back in 2012-10-22 - http://git.io/mq-TlA I will look up stream to see why there is no last built revision; for this job, it looks like there should be one.
            jmoody Joshua Moody added a comment -

            > Is it only happening when there isn't a previous build?

            Confirmed. Once the job has changes, I no longer see this NPE.

            jmoody Joshua Moody added a comment - > Is it only happening when there isn't a previous build? Confirmed. Once the job has changes, I no longer see this NPE.

            Just wanted to throw my name into the ring as someone who is also hung up on this bug.

            richid Rich Schumacher added a comment - Just wanted to throw my name into the ring as someone who is also hung up on this bug.
            simonlynen Simon Lynen added a comment -

            +1

            simonlynen Simon Lynen added a comment - +1
            tonyghita Tony Ghita added a comment -

            I'm also having this issue. Was there a fix for this?

            tonyghita Tony Ghita added a comment - I'm also having this issue. Was there a fix for this?
            sovietaced Jason Parraga added a comment -

            +1

            sovietaced Jason Parraga added a comment - +1
            jmoody Joshua Moody added a comment -

            UPDATE: The project I am working on has submodules. If I remove the Advanced Submodule Processing options (or disable processing), I don't get this NPE. Of course, my build then fails downstream.

            I am sponsoring a fix for 50USD.

            jmoody Joshua Moody added a comment - UPDATE: The project I am working on has submodules . If I remove the Advanced Submodule Processing options (or disable processing), I don't get this NPE. Of course, my build then fails downstream. I am sponsoring a fix for 50USD.
            davidtanner David Tanner added a comment -

            Following the lines that lead to the commit notifier I don't understand how this line gets null for the lastRevision. Can you please PM me the log from one of the failed builds?

            davidtanner David Tanner added a comment - Following the lines that lead to the commit notifier I don't understand how this line gets null for the lastRevision. Can you please PM me the log from one of the failed builds?
            davidtanner David Tanner added a comment -

            I can very easily create this null pointer error if there is nothing checked out using the git scm. As long as I have that set then there is a last build revision.

            davidtanner David Tanner added a comment - I can very easily create this null pointer error if there is nothing checked out using the git scm. As long as I have that set then there is a last build revision.
            meenal5254 Meenal Khandelwal added a comment - - edited

            I am getting a similar error, It is showing this error:

            ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception
            11:07:06 java.lang.NullPointerException
            11:07:06 	at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:53)
            11:07:06 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            11:07:06 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
            11:07:06 	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
            11:07:06 	at hudson.model.Build$BuildExecution.post2(Build.java:183)
            11:07:06 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
            11:07:06 	at hudson.model.Run.execute(Run.java:1765)
            11:07:06 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            11:07:06 	at hudson.model.ResourceController.execute(ResourceController.java:89)
            11:07:06 	at hudson.model.Executor.run(Executor.java:240)
            

            This error is associated with only one pull request. I tried building other pull request for the same repository, they all ran fine.

            meenal5254 Meenal Khandelwal added a comment - - edited I am getting a similar error, It is showing this error: ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception 11:07:06 java.lang.NullPointerException 11:07:06 at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:53) 11:07:06 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 11:07:06 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) 11:07:06 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) 11:07:06 at hudson.model.Build$BuildExecution.post2(Build.java:183) 11:07:06 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) 11:07:06 at hudson.model.Run.execute(Run.java:1765) 11:07:06 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 11:07:06 at hudson.model.ResourceController.execute(ResourceController.java:89) 11:07:06 at hudson.model.Executor.run(Executor.java:240) This error is associated with only one pull request. I tried building other pull request for the same repository, they all ran fine.
            davidtanner David Tanner added a comment -

            What is special about that pull request, or the branch that it is pulling from?

            davidtanner David Tanner added a comment - What is special about that pull request, or the branch that it is pulling from?

            There was nothing different about this branch. It was just a pull request for the same repo in which the branch exist. I had a similar branch which worked just fine.

            meenal5254 Meenal Khandelwal added a comment - There was nothing different about this branch. It was just a pull request for the same repo in which the branch exist. I had a similar branch which worked just fine.
            davidtanner David Tanner added a comment -

            Was the branch deleted or changed before the build ran or something? When I first got things running here there were several times that someone would close the PR just after Jenkins picked it up. But I don't recall this being the error.

            davidtanner David Tanner added a comment - Was the branch deleted or changed before the build ran or something? When I first got things running here there were several times that someone would close the PR just after Jenkins picked it up. But I don't recall this being the error.
            pradeepto Pradeepto Bhattacharya added a comment - - edited

            I was just bitten by this issue. I am using GitHub Pull Request Builder (1.16-0) along with Github plugin (1.9.1).

            I am trying build a PR using GHPRB.

            ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception
            java.lang.NullPointerException
            	at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:53)
            	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
            	at hudson.model.Build$BuildExecution.post2(Build.java:182)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
            	at hudson.model.Run.execute(Run.java:1731)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:88)
            	at hudson.model.Executor.run(Executor.java:232)
            

            Is there anything else I can provide to help with this error?

            pradeepto Pradeepto Bhattacharya added a comment - - edited I was just bitten by this issue. I am using GitHub Pull Request Builder (1.16-0) along with Github plugin (1.9.1). I am trying build a PR using GHPRB. ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception java.lang.NullPointerException at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:53) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:182) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669) at hudson.model.Run.execute(Run.java:1731) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) Is there anything else I can provide to help with this error?
            oleg_nenashev Oleg Nenashev added a comment -

            Also experienced the issue, it breaks our branch management flows.
            Hope to submit a patch soon.

            oleg_nenashev Oleg Nenashev added a comment - Also experienced the issue, it breaks our branch management flows. Hope to submit a patch soon.
            oleg_nenashev Oleg Nenashev added a comment -

            I'm going to add an option, which disables the build failing if there's no info about Git changeset.
            Would it be a convenient solution?

            oleg_nenashev Oleg Nenashev added a comment - Better issue's analysis: https://github.com/jenkinsci/github-plugin/pull/46 Annotation for the git-plugin: https://github.com/jenkinsci/git-plugin/pull/259 I'm going to add an option, which disables the build failing if there's no info about Git changeset. Would it be a convenient solution?

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/hudson/plugins/git/util/BuildData.java
            http://jenkins-ci.org/commit/git-plugin/d0180c4a7e8ba3b72b1e7a5010ee578c92bd34e5
            Log:
            JENKINS-23641 - Annotate BuildData::getLastBuiltRevision()

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/plugins/git/util/BuildData.java http://jenkins-ci.org/commit/git-plugin/d0180c4a7e8ba3b72b1e7a5010ee578c92bd34e5 Log: JENKINS-23641 - Annotate BuildData::getLastBuiltRevision() Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Code changed in jenkins
            User: Mark Waite
            Path:
            src/main/java/hudson/plugins/git/util/BuildData.java
            http://jenkins-ci.org/commit/git-plugin/e0760d629ffe4a8f6b278ca66f7846450f1724e8
            Log:
            Merge pull request #259 from oleg-nenashev/JENKINS-23641

            JENKINS-23641 - Annotate BuildData::getLastBuiltRevision()

            Compare: https://github.com/jenkinsci/git-plugin/compare/e43d17f78690...e0760d629ffe

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/hudson/plugins/git/util/BuildData.java http://jenkins-ci.org/commit/git-plugin/e0760d629ffe4a8f6b278ca66f7846450f1724e8 Log: Merge pull request #259 from oleg-nenashev/ JENKINS-23641 JENKINS-23641 - Annotate BuildData::getLastBuiltRevision() Compare: https://github.com/jenkinsci/git-plugin/compare/e43d17f78690...e0760d629ffe

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/hudson/plugins/git/util/BuildData.java
            http://jenkins-ci.org/commit/git-plugin/d15e4108e18cef7b66160f670e5d30f2ca2c652c
            Log:
            JENKINS-23641 - Annotate BuildData::getLastBuiltRevision()

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/hudson/plugins/git/util/BuildData.java http://jenkins-ci.org/commit/git-plugin/d15e4108e18cef7b66160f670e5d30f2ca2c652c Log: JENKINS-23641 - Annotate BuildData::getLastBuiltRevision() Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java
            http://jenkins-ci.org/commit/github-plugin/c4347f829f84fec909b7cfe1e6bc88b265a58e48
            Log:
            JENKINS-23641 - Handle possible nulls if Git checkout fails

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java http://jenkins-ci.org/commit/github-plugin/c4347f829f84fec909b7cfe1e6bc88b265a58e48 Log: JENKINS-23641 - Handle possible nulls if Git checkout fails Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java
            src/main/resources/com/cloudbees/jenkins/Messages.properties
            src/test/java/com/cloudbees/jenkins/GitHubCommitNotifierTest.java
            http://jenkins-ci.org/commit/github-plugin/25c1e85dd48d2bbe878aa7eb26f862b6e9f52971
            Log:
            JENKINS-23641 - Direct tests for the issue

            Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java src/main/resources/com/cloudbees/jenkins/Messages.properties src/test/java/com/cloudbees/jenkins/GitHubCommitNotifierTest.java http://jenkins-ci.org/commit/github-plugin/25c1e85dd48d2bbe878aa7eb26f862b6e9f52971 Log: JENKINS-23641 - Direct tests for the issue Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java
            src/main/resources/com/cloudbees/jenkins/GitHubCommitNotifier/config.jelly
            src/main/resources/com/cloudbees/jenkins/Messages.properties
            src/test/java/com/cloudbees/jenkins/GitHubCommitNotifierTest.java
            http://jenkins-ci.org/commit/github-plugin/b6f53a72bc27dd81cc1241c10c3e63d1606138de
            Log:
            Merge pull request #46 from oleg-nenashev/JENKINS-23641

            [JENKINS-23641,JENKINS-25312] - Handle possible nulls if Git checkout fails

            Compare: https://github.com/jenkinsci/github-plugin/compare/0f29b1d8d500...b6f53a72bc27

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java src/main/resources/com/cloudbees/jenkins/GitHubCommitNotifier/config.jelly src/main/resources/com/cloudbees/jenkins/Messages.properties src/test/java/com/cloudbees/jenkins/GitHubCommitNotifierTest.java http://jenkins-ci.org/commit/github-plugin/b6f53a72bc27dd81cc1241c10c3e63d1606138de Log: Merge pull request #46 from oleg-nenashev/ JENKINS-23641 [JENKINS-23641,JENKINS-25312] - Handle possible nulls if Git checkout fails Compare: https://github.com/jenkinsci/github-plugin/compare/0f29b1d8d500...b6f53a72bc27
            markewaite Mark Waite added a comment -

            Fix released in git plugin 2.3 10 Nov 2014

            markewaite Mark Waite added a comment - Fix released in git plugin 2.3 10 Nov 2014
            oleg_nenashev Oleg Nenashev added a comment -

            @Mark
            Git plugin just contains annotations.
            The fix to github-plugin has been applied here: https://github.com/jenkinsci/github-plugin/pull/46

            Hope to release the plugin today

            oleg_nenashev Oleg Nenashev added a comment - @Mark Git plugin just contains annotations. The fix to github-plugin has been applied here: https://github.com/jenkinsci/github-plugin/pull/46 Hope to release the plugin today

            People

              oleg_nenashev Oleg Nenashev
              frank Frank K
              Votes:
              5 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: