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

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • tfs-plugin
    • None
    • Jenkins 2.138.3
      TFS plugin 5.142

      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

          [JENKINS-54569] java.lang.NullPointerException when upding status in TFS/Team Services

          rafambbr, bartvdrmeulen: How do you trigger the job?

          Florian Bäuerle added a comment - rafambbr , bartvdrmeulen : How do you trigger the job?

          Oh and please also report on which TFS Version this happens. I bet you both use self-hosted services as the previous implementation did not work with VSTS/AzureDevops.

          Florian Bäuerle added a comment - Oh and please also report on which TFS Version this happens. I bet you both use self-hosted services as the previous implementation did not work with VSTS/AzureDevops.

          TFS Version is TFS2018 Update 3.1 (on premises)

          The job is triggered by TFS through a service hook

          Bart van der Meulen added a comment - TFS Version is TFS2018 Update 3.1 (on premises) The job is triggered by TFS through a service hook

          okay, which one exactly?

          Is it a "Trigger git build" or "Trigger generic build" hook? I guess it's a "Trigger git build" hook, because the other one works pretty fine for me.

          I made some changes that probably now cause your problems.

          Florian Bäuerle added a comment - okay, which one exactly? Is it a "Trigger git build" or "Trigger generic build" hook? I guess it's a "Trigger git build" hook, because the other one works pretty fine for me. I made some changes that probably now cause your problems.

          I use the 'Trigger generic build' action

          Bart van der Meulen added a comment - I use the 'Trigger generic build' action

          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
          

          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

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

          please test and review.

          Florian Bäuerle added a comment - opened a Pull-Request: https://github.com/jenkinsci/tfs-plugin/pull/217 please test and review.

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

          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.

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

          Florian Bäuerle added a comment - Thanks. Let's hope that a maintainer will eventually accept the PR.

          Ricard F added a comment -

          I'm having this issue configuring against devops azure. Is there anyworkaround? fbaeuerle bartvdrmeulen

          Ricard F added a comment - I'm having this issue configuring against devops azure. Is there anyworkaround? fbaeuerle bartvdrmeulen

            redsolo redsolo
            bartvdrmeulen Bart van der Meulen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: