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

java.lang.NullPointerException when upding status in TFS/Team Services

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: tfs-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.138.3
      TFS plugin 5.142
    • Similar Issues:

      Description

      After updating the plugin to version 5.142 when updating the status with the TFS/Team Services following backtraces are given and the status is not updated

       

      ERROR: Error while trying to update pending status in TFS/Team ServicesERROR: Error while trying to update pending status in TFS/Team Servicesjava.lang.NullPointerException at hudson.plugins.tfs.util.TeamStatus.addStatus(TeamStatus.java:87) at hudson.plugins.tfs.util.TeamStatus.createFromRun(TeamStatus.java:66) at hudson.plugins.tfs.TeamPendingStatusBuildStep.perform(TeamPendingStatusBuildStep.java:44) at hudson.plugins.tfs.listeners.JenkinsRunListener.onStarted(JenkinsRunListener.java:35) at hudson.model.listeners.RunListener.fireStarted(RunListener.java:240) at hudson.model.Run.execute(Run.java:1815) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)
      ERROR: Error while trying to update completion status in TFS/Team Servicesjava.lang.NullPointerException at hudson.plugins.tfs.util.TeamStatus.addStatus(TeamStatus.java:87) at hudson.plugins.tfs.util.TeamStatus.createFromRun(TeamStatus.java:66) at hudson.plugins.tfs.TeamCompletedStatusPostBuildAction.perform(TeamCompletedStatusPostBuildAction.java:47) at hudson.plugins.tfs.TeamCompletedStatusPostBuildAction.perform(TeamCompletedStatusPostBuildAction.java:41) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1844) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)
      ERROR: Error while trying to update completion status in TFS/Team Servicesjava.lang.NullPointerException at hudson.plugins.tfs.util.TeamStatus.addStatus(TeamStatus.java:87) at hudson.plugins.tfs.util.TeamStatus.createFromRun(TeamStatus.java:66) at hudson.plugins.tfs.TeamCompletedStatusPostBuildAction.perform(TeamCompletedStatusPostBuildAction.java:47) at hudson.plugins.tfs.listeners.JenkinsRunListener.onCompleted(JenkinsRunListener.java:48) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211) at hudson.model.Run.execute(Run.java:1864) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)

       

      When rolling back the plugin to version 5.133 it works again

        Attachments

          Issue Links

            Activity

            Hide
            fbaeuerle Florian Bäuerle added a comment -

            Thank you for the information.

            Apparently I broke your Jenkins due to some misassumptions I made about the plugin's abilities to trigger Jenkins Jobs – sorry.

            I think I've got a working fix here: https://github.com/mrflow/tfs-plugin/tree/wip/jenkins-54569

            But I tested that with a Multibranch Pipeline Job (You seem to use a Freestyle Job) and the Job triggering part of the plugin is pretty messy. So I would kindly like to ask you to test the fix if possible.

            Building the plugin is possible with (you need maven):

            mvn package
            
            Show
            fbaeuerle Florian Bäuerle added a comment - Thank you for the information. Apparently I broke your Jenkins due to some misassumptions I made about the plugin's abilities to trigger Jenkins Jobs – sorry. I think I've got a working fix here: https://github.com/mrflow/tfs-plugin/tree/wip/jenkins-54569 But I tested that with a Multibranch Pipeline Job (You seem to use a Freestyle Job) and the Job triggering part of the plugin is pretty messy. So I would kindly like to ask you to test the fix if possible. Building the plugin is possible with (you need maven): mvn package
            Hide
            fbaeuerle Florian Bäuerle added a comment -

            opened a Pull-Request:
            https://github.com/jenkinsci/tfs-plugin/pull/217

            please test and review.

            Show
            fbaeuerle Florian Bäuerle added a comment - opened a Pull-Request: https://github.com/jenkinsci/tfs-plugin/pull/217 please test and review.
            Hide
            bartvdrmeulen Bart van der Meulen added a comment -

            I created a lokal build with the change and tested it, no more backtraces and the status is rapported back correctly.

            Show
            bartvdrmeulen Bart van der Meulen added a comment - I created a lokal build with the change and tested it, no more backtraces and the status is rapported back correctly.
            Hide
            fbaeuerle Florian Bäuerle added a comment -

            Thanks. Let's hope that a maintainer will eventually accept the PR.

            Show
            fbaeuerle Florian Bäuerle added a comment - Thanks. Let's hope that a maintainer will eventually accept the PR.
            Hide
            ricardf Ricard F added a comment -

            I'm having this issue configuring against devops azure. Is there anyworkaround? Florian Bäuerle Bart van der Meulen

            Show
            ricardf Ricard F added a comment - I'm having this issue configuring against devops azure. Is there anyworkaround? Florian Bäuerle Bart van der Meulen

              People

              • Assignee:
                redsolo redsolo
                Reporter:
                bartvdrmeulen Bart van der Meulen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: