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

Flexible Publish NPE with no publishers for a conditional publisher

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • Flexible Publish 0.13
      tested with Jenkins 1.425, Jenkins 1.580.1

    Description

      (Copiied from JENKINS-19985)
      Steps to reproduce:

      1. Create a new freestyle project
      2. Add the Flexible publish as a post build action.
      3. Save the project without any actions for a conditional action.
      4. It will throw an exception, however the save happens!
        • In Jenkins 1.425, the exception is recorded only in the system log.
        • In Jenkins 1.580.1, the exception is displayed also on the browser.
      5. Execute a build and it will throw the NPE.

      Another way you can get this NPE:

      1. Same steps as 1, 2, 3, 4.
      2. Restarting Jenkins throws this NPE, however the project will fail to load and show an error about project actions.

      I set this to Critical, as this cause jobs lost for the latter problem.

      Attachments

        1. config.xml
          1 kB
        2. ExceptionOnBoot.txt
          1 kB
        3. ExceptionOnBuild.txt
          1 kB
        4. ExceptionOnSave.txt
          22 kB

        Issue Links

          Activity

            ikedam ikedam added a comment - This should be a problem in {ConditionalPublisher.DescriptorImpl#newInstance} . https://github.com/jenkinsci/flexible-publish-plugin/blob/flexible-publish-0.13/src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java#L278
            jglick Jesse Glick added a comment -

            Any override of newInstance should be considered automatically suspect. With few exceptions, if you create Describable/Descriptor and config.jelly correctly, you do not need any tricks.

            jglick Jesse Glick added a comment - Any override of newInstance should be considered automatically suspect. With few exceptions, if you create Describable / Descriptor and config.jelly correctly, you do not need any tricks.

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java
            src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java
            http://jenkins-ci.org/commit/flexible-publish-plugin/932c255cb1236e61efcb4c9549313ca3ec5f65b5
            Log:
            Merge pull request #7 from christ66/ZD-23986

            [FIXED JENKINS-26452] Prevent NPE if no publisher in conditional step.

            Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/02e403ea684b...932c255cb123

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java http://jenkins-ci.org/commit/flexible-publish-plugin/932c255cb1236e61efcb4c9549313ca3ec5f65b5 Log: Merge pull request #7 from christ66/ZD-23986 [FIXED JENKINS-26452] Prevent NPE if no publisher in conditional step. Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/02e403ea684b...932c255cb123

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java
            src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/config.xml
            src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/jobs/affectedBy26452/config.xml
            http://jenkins-ci.org/commit/flexible-publish-plugin/2b8793a44f515ed2f3328e2cb4b226f835f4129f
            Log:
            JENKINS-26452 Tests to reproduce JENKINS-26452.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/config.xml src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/jobs/affectedBy26452/config.xml http://jenkins-ci.org/commit/flexible-publish-plugin/2b8793a44f515ed2f3328e2cb4b226f835f4129f Log: JENKINS-26452 Tests to reproduce JENKINS-26452 .

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java
            src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/config.xml
            src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/jobs/affectedBy26452/config.xml
            http://jenkins-ci.org/commit/flexible-publish-plugin/6028278c86078e04957ff5a7c88ac077eb5f497d
            Log:
            Merge pull request #8 from ikedam/feature/JENKINS-26452_reproduce

            JENKINS-26452 Tests to reproduce JENKINS-26452.

            Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/932c255cb123...6028278c8607

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest.java src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/config.xml src/test/resources/org/jenkins_ci/plugins/flexible_publish/ConfigurationTest/testRecoverFrom26452/jobs/affectedBy26452/config.xml http://jenkins-ci.org/commit/flexible-publish-plugin/6028278c86078e04957ff5a7c88ac077eb5f497d Log: Merge pull request #8 from ikedam/feature/ JENKINS-26452 _reproduce JENKINS-26452 Tests to reproduce JENKINS-26452 . Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/932c255cb123...6028278c8607
            ikedam ikedam added a comment -

            Released in 0.14.1.

            (0.14.1 is a bug fix for 0.13, and should have been released as 0.13.1 but I mistook)

            ikedam ikedam added a comment - Released in 0.14.1. (0.14.1 is a bug fix for 0.13, and should have been released as 0.13.1 but I mistook)

            People

              ikedam ikedam
              ikedam ikedam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: