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

Viewing canceled Pipeline jobs can get NPE from UserInterruption/summary.groovy

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core, pipeline
    • Jenkins 2.24, workflow-job 2.7, Linux vmkvmx02 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

      Sometimes when viewing cancelled pipeline jobs, an exception is shown. I'm not sure if it's all cancelled jobs or just particular ones. Can still view console logs by entering url in manually.

      javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/home/jenkins/plugins/workflow-job/WEB-INF/lib/workflow-job.jar!/org/jenkinsci/plugins/workflow/job/WorkflowRun/index.jelly:63:93: <st:include> org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.24.jar!/lib/hudson/summary.jelly:105:31: <d:invokeBody> Cannot get property 'fullName' on null object
      

          [JENKINS-38721] Viewing canceled Pipeline jobs can get NPE from UserInterruption/summary.groovy

          Jesse Glick added a comment -
          org.apache.commons.jelly.JellyTagException: …/jenkins-core-2.24.jar!/lib/hudson/summary.jelly:105:31: <d:invokeBody> Cannot get property 'fullName' on null object
          	at …
          Caused by: java.lang.NullPointerException: Cannot get property 'fullName' on null object
          	at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
          	at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
          	at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
          	at jenkins.model.CauseOfInterruption.UserInterruption.summary.run(summary.groovy:4)
          

          The problematic expression in my.user.fullName. Yet UserInterruption.getUser calls User.get, which should never return null. So I am not sure what is going on.

          At any rate, it looks like a core bug. Any known way to reproduce from scratch?

          Jesse Glick added a comment - org.apache.commons.jelly.JellyTagException: …/jenkins-core-2.24.jar!/lib/hudson/summary.jelly:105:31: <d:invokeBody> Cannot get property 'fullName' on null object at … Caused by: java.lang.NullPointerException: Cannot get property 'fullName' on null object at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172) at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) at jenkins.model.CauseOfInterruption.UserInterruption.summary.run(summary.groovy:4) The problematic expression in my.user.fullName . Yet UserInterruption.getUser calls User.get , which should never return null. So I am not sure what is going on. At any rate, it looks like a core bug. Any known way to reproduce from scratch?

          Nick Sonneveld added a comment - - edited

          jglick I haven't tried from scratch. We do run Jenkins internally with zero security enabled. Everyone is an anonymous user which might explain why User.get is null.

          Nick Sonneveld added a comment - - edited jglick I haven't tried from scratch. We do run Jenkins internally with zero security enabled. Everyone is an anonymous user which might explain why User.get is null.

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - It is a regression due to JENKINS-36594 . https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy needs to be fixed

          Jesse Glick added a comment -

          Can you link your PR please?

          Jesse Glick added a comment - Can you link your PR please?

          Oleg Nenashev added a comment -

          jglick FYI we have automatic referencing of PRs now (see the "Development" section on the right sidepanel)

          Oleg Nenashev added a comment - jglick FYI we have automatic referencing of PRs now (see the "Development" section on the right sidepanel)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/CauseOfInterruption.java
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties
          http://jenkins-ci.org/commit/jenkins/91ad59214234e7724d586f64f8fb6db35104857b
          Log:
          [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630)

          • [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing

          It is a regression introduced in JENKINS-36594

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/CauseOfInterruption.java core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties http://jenkins-ci.org/commit/jenkins/91ad59214234e7724d586f64f8fb6db35104857b Log: [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 JENKINS-38721 - Fix typo

          Oleg Nenashev added a comment - - edited

          The fix has been integrated towards jenkins-2.31. Marking as LTS candidate since it's a regression in 2.14, which likely deserves backporting into 2.19.3 (8 votes in total)

          Oleg Nenashev added a comment - - edited The fix has been integrated towards jenkins-2.31. Marking as LTS candidate since it's a regression in 2.14, which likely deserves backporting into 2.19.3 (8 votes in total)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/CauseOfInterruption.java
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties
          http://jenkins-ci.org/commit/jenkins/0399037f842d1c9c4fbbc970421fafa3ecdac7eb
          Log:
          [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630)

          • [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing

          It is a regression introduced in JENKINS-36594

          (cherry picked from commit 91ad59214234e7724d586f64f8fb6db35104857b)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/CauseOfInterruption.java core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties http://jenkins-ci.org/commit/jenkins/0399037f842d1c9c4fbbc970421fafa3ecdac7eb Log: [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 JENKINS-38721 - Fix typo (cherry picked from commit 91ad59214234e7724d586f64f8fb6db35104857b)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/steps/CatchErrorStepTest.java
          http://jenkins-ci.org/commit/workflow-basic-steps-plugin/a1073f63461efa41b97d038191610c9dcbd60327
          Log:
          Adjust test to work against -Djenkins.version=2.19.4 after JENKINS-36594 & JENKINS-38721.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/steps/CatchErrorStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/a1073f63461efa41b97d038191610c9dcbd60327 Log: Adjust test to work against -Djenkins.version=2.19.4 after JENKINS-36594 & JENKINS-38721 .

            oleg_nenashev Oleg Nenashev
            sonneveldsmartward Nick Sonneveld
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: