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

NullPointerException Creating and Resolving Issues

XMLWordPrintable

      When resolving an incident:

      Resolving incident
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.resolveIncident(PagerDutyTrigger.java:225)
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.perform(PagerDutyTrigger.java:213)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      Build step 'PagerDuty Incident Trigger' marked build as failure
      Finished: FAILURE
      

      When attempting to create one:

      ERROR: Tried to trigger PD with apiKey = [***]
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.triggerPagerDuty(PagerDutyTrigger.java:266)
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.perform(PagerDutyTrigger.java:210)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      Build step 'PagerDuty Incident Trigger' marked build as failure
      Finished: FAILURE
      

      I thought maybe the issue was that the incidentKey didn't exist in PagerDuty? I assumed you could create an ad-hoc key and it would map to a consistent incident (otherwise I'm not sure how a subsequent resolveIncident would correlate an incident triggered from a previous trigger to a new one).

      The contextual help bubble says: PagerDuty incident id if available (otherwise it will create one).

      If I leave the incidentKey field blank:

      java.lang.IllegalArgumentException: 'incidentKey' must not be blank. Was: ''
      	at com.squareup.pagerduty.incidents.Util.checkArgument(Util.java:39)
      	at com.squareup.pagerduty.incidents.Util.checkStringArgument(Util.java:26)
      	at com.squareup.pagerduty.incidents.Resolution$Builder.<init>(Resolution.java:44)
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.resolveIncident(PagerDutyTrigger.java:220)
      	at org.jenkinsci.plugins.pagerduty.PagerDutyTrigger.perform(PagerDutyTrigger.java:213)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      Build step 'PagerDuty Incident Trigger' marked build as failure
      Finished: FAILURE
      

      Set to major in the context of this plugin. Certainly not a major loss to Jenkins overall! We're trying to use the plugin to drive periodic acceptance tests - when a sequence of API interactions fails, the build fails, we get an alert. We want this to run every 5 minutes. If a subsequent run succeeds the incident should be resolved automatically.

      Jenkins Version: 1.6.3
      Pagerduty Plugin Version: 0.2.4

            alexanderlz Alexander Leibzon
            jacobstr Jacob Straszynski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: