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

Jenkinsfile build fail - Null pointer exception in PipelineTriggersJobProperty

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have Jenkinsfile build and workflow-job plugin installed. Jenkins and all plugins on latest version. When my build first fail (i think reason is not important, some error in Jenkinsfile script) every next build fail on NPE.

      I think failed build broke some trigger - set it to null, i don't know why, but it is real. Because every next build try to stop all triggers, every next build fail on NPE. So this job is broken forever.

      I think broken code is on PipelineTriggersJobProperty.java:106. Fix is easy - add 

      if (trigger !=null) {

      condition.

      And .. voilà - problem is gone. 

        Attachments

          Activity

          Hide
          bigboban Petr Leitner added a comment -

          Still no progress? Plugin still buggy i still have to use own patched version..

          Show
          bigboban Petr Leitner added a comment - Still no progress? Plugin still buggy i still have to use own patched version..
          Hide
          bigboban Petr Leitner added a comment - - edited

          Any progress here? Blocker bug is still there and blocks our builds. I have verified source fix but nobody wants it? No way how to open PR?

          Show
          bigboban Petr Leitner added a comment - - edited Any progress here? Blocker bug is still there and blocks our builds. I have verified source fix but nobody wants it? No way how to open PR?
          Hide
          bigboban Petr Leitner added a comment -

          Try to understand. I have production jenkins server and I found "not stable", "not robust", "weird" code in workflow-job-plugin. It is absolutely not possible i will investigate more. I did what I did and I will not do anything more, because it's almost impossible to find which part of Jenkins created "null" trigger. And it is totally impossible i will do some tests on my Jenkins instance. 

           

          Still i think someone should fix this plugin to be rock stable = null trigger resistant. And if you insert some extra logging maybe me or someone other will catch that log message and maybe it will point to other buggy part of Jenkins.

          Show
          bigboban Petr Leitner added a comment - Try to understand. I have production jenkins server and I found "not stable", "not robust", "weird" code in workflow-job-plugin. It is absolutely not possible i will investigate more. I did what I did and I will not do anything more, because it's almost impossible to find which part of Jenkins created "null" trigger. And it is totally impossible i will do some tests on my Jenkins instance.    Still i think someone should fix this plugin to be rock stable = null trigger resistant. And if you insert some extra logging maybe me or someone other will catch that log message and maybe it will point to other buggy part of Jenkins.
          Hide
          jglick Jesse Glick added a comment -

          i have no idea which part of jenkins insert null into trigger

          Presumably some buggy plugin. You could bisect based on plugin installation list, though there may be a way to insert a diagnostic stack trace elsewhere, in Jenkins core perhaps.

          Vaguely recall some related issue a few years ago.

          Show
          jglick Jesse Glick added a comment - i have no idea which part of jenkins insert null into trigger Presumably some buggy plugin. You could bisect based on plugin installation list, though there may be a way to insert a diagnostic stack trace elsewhere, in Jenkins core perhaps. Vaguely recall some related issue a few years ago.
          Hide
          bigboban Petr Leitner added a comment -

          I understand your argument. But i cannot reproduce problem because i have no idea which part of jenkins insert null into triggers. And i think i will never know how it is possible. So i think this plugin should be fixed as resistant against null values in triggers List. Maybe some logger.warn should be added to detect future "null cases".

           

          And as I mentioned above - source is inconsistent - on one place it handles null in trigger on input, but on other places not.

          Show
          bigboban Petr Leitner added a comment - I understand your argument. But i cannot reproduce problem because i have no idea which part of jenkins insert null into triggers. And i think i will never know how it is possible. So i think this plugin should be fixed as resistant against null values in triggers List. Maybe some logger.warn should be added to detect future "null cases".   And as I mentioned above - source is inconsistent - on one place it handles null in trigger on input, but on other places not.
          Hide
          jglick Jesse Glick added a comment -

          A patch making the exception go away is trivially recreated, but what we need is steps to reproduce the problem from scratch. Quite possibly the real bug lies in another component, but to analyze that it is necessary to get more information.

          Show
          jglick Jesse Glick added a comment - A patch making the exception go away is trivially recreated, but what we need is steps to reproduce the problem from scratch . Quite possibly the real bug lies in another component, but to analyze that it is necessary to get more information.
          Hide
          bigboban Petr Leitner added a comment -

          Problem si much wider, bug is on many places in PipelineTriggersJobProperty.java.

          As you can see here, author assume one trigger may come null from outside:

           

          public void removeTrigger(Trigger t) {
           // TODO: Will we get equality for trigger instances of the same Descriptor?
           Trigger toRemove = getTriggerForDescriptor(t.getDescriptor());
          
           if (toRemove != null) {
           triggers.remove(toRemove);
           }
          }
          

           

          But other places in this source are not null-safe, for example:

           

          public void stopTriggers() {
           for (Trigger trigger : triggers) {
           trigger.stop();
           }
          }
          

           

          A have fixed source, but i cannot make pull requests. Why?

          Show
          bigboban Petr Leitner added a comment - Problem si much wider, bug is on many places in PipelineTriggersJobProperty.java. As you can see here, author assume one trigger may come null from outside:   public void removeTrigger(Trigger t) { // TODO: Will we get equality for trigger instances of the same Descriptor? Trigger toRemove = getTriggerForDescriptor(t.getDescriptor()); if (toRemove != null ) { triggers.remove(toRemove); } }   But other places in this source are not null-safe, for example:   public void stopTriggers() { for (Trigger trigger : triggers) { trigger.stop(); } }   A have fixed source, but i cannot make pull requests. Why?
          Hide
          bigboban Petr Leitner added a comment -

          New version 2.40 of plugin was today installed on my jenkins and my patched plugin is gone and problem is back. It means last version 2.40 still has this problem. Please fix.

          Show
          bigboban Petr Leitner added a comment - New version 2.40 of plugin was today installed on my jenkins and my patched plugin is gone and problem is back. It means last version 2.40 still has this problem. Please fix.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            bigboban Petr Leitner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: