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

NPE TriggeredBuildSelector during CopyArtifact

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: copyartifact-plugin
    • Labels:
      None
    • Environment:
      Windows Jenkins ver. 1.511 CopyArtifact version 1.26
    • Similar Issues:

      Description

      We started seeing this issue at times, in particular it seems, when two sets of upstream jobs are flagged as being upstream triggers (Why that is happening is another issue).

      C:\Jenkins\workspace\Trunk_Dev_D_Done>exit 0
      FATAL: null
      java.lang.NullPointerException
      at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:61)
      at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73)
      at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73)
      at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:195)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:584)
      at hudson.model.Run.execute(Run.java:1575)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)

        Attachments

          Activity

          Hide
          yamoinca yamoinca added a comment -

          Note since upgrading to v1.526 (early August) we hadn't seen this error again until today. But in this case, it does not seem as if there are multiple upstream jobs mentioned as a trigger.

          Slightly different stack:

          FATAL: null
          java.lang.NullPointerException
          at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:61)
          at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73)
          at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:199)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
          at hudson.model.Build$BuildExecution.build(Build.java:199)
          at hudson.model.Build$BuildExecution.doRun(Build.java:160)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
          at hudson.model.Run.execute(Run.java:1597)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:247)

          Show
          yamoinca yamoinca added a comment - Note since upgrading to v1.526 (early August) we hadn't seen this error again until today. But in this case, it does not seem as if there are multiple upstream jobs mentioned as a trigger. Slightly different stack: FATAL: null java.lang.NullPointerException at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:61) at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73) at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:199) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1597) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247)
          Hide
          hidminds Daniel Fischer added a comment - - edited

          Yesterday, I have seen this error in 3 of our jobs.
          Two of them are configured to be triggered by one upstream job. One is configured to be triggered by two upstream jobs.
          I do not believe that this issue has something to do with the number of upstream jobs.

          Using locally configured password for connection to :pserver:secretuser@secrethost:/secretdir
          cvs rlog -S -d06 Nov 2013 18:52:38 +0100<07 Nov 2013 19:26:46 +0100 secretcvsmodule
          FATAL: null
          java.lang.NullPointerException
          at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:61)
          at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73)
          at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:254)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:780)
          at hudson.model.Build$BuildExecution.build(Build.java:199)
          at hudson.model.Build$BuildExecution.doRun(Build.java:160)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565)
          at hudson.model.Run.execute(Run.java:1592)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)

          We are using Jenkins 1.509.4 and Copy Artifact Plugin 1.28 on Linux.

          Show
          hidminds Daniel Fischer added a comment - - edited Yesterday, I have seen this error in 3 of our jobs. Two of them are configured to be triggered by one upstream job. One is configured to be triggered by two upstream jobs. I do not believe that this issue has something to do with the number of upstream jobs. Using locally configured password for connection to :pserver:secretuser@secrethost:/secretdir cvs rlog -S -d06 Nov 2013 18:52:38 +0100<07 Nov 2013 19:26:46 +0100 secretcvsmodule FATAL: null java.lang.NullPointerException at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:61) at hudson.plugins.copyartifact.TriggeredBuildSelector.getBuild(TriggeredBuildSelector.java:73) at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:254) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:780) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565) at hudson.model.Run.execute(Run.java:1592) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) We are using Jenkins 1.509.4 and Copy Artifact Plugin 1.28 on Linux.
          Hide
          ikedam ikedam added a comment -

          It can be reproduced with following steps:

          1. Create a free style project UPSTREAM
            • makes an artifact
            • triggers INTERMEDIATE
          2. Create a free style project INTERMEDIATE
            • triggers DOWNSTREAM
          3. Create a free style project DOWNSTREAM
            • set the quiet period to a long value.
            • copies an artifact from UPSTREAM with TriggeredBuildSelector
          4. Launch UPSTREAM
          5. After INTERMEDIATE finished and before DOWNSTREAM starts, delete the build of INTERMEDIATE.
          Show
          ikedam ikedam added a comment - It can be reproduced with following steps: Create a free style project UPSTREAM makes an artifact triggers INTERMEDIATE Create a free style project INTERMEDIATE triggers DOWNSTREAM Create a free style project DOWNSTREAM set the quiet period to a long value. copies an artifact from UPSTREAM with TriggeredBuildSelector Launch UPSTREAM After INTERMEDIATE finished and before DOWNSTREAM starts, delete the build of INTERMEDIATE.
          Show
          ikedam ikedam added a comment - https://github.com/jenkinsci/copyartifact-plugin/pull/46
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java
          src/test/java/hudson/plugins/copyartifact/testutils/RemoveUpstreamBuilder.java
          http://jenkins-ci.org/commit/copyartifact-plugin/72435901fdaea4c9202a771b752f205e6eb69462
          Log:
          JENKINS-18804 Added a test to reproduce JENKINS-18804.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java src/test/java/hudson/plugins/copyartifact/testutils/RemoveUpstreamBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/72435901fdaea4c9202a771b752f205e6eb69462 Log: JENKINS-18804 Added a test to reproduce JENKINS-18804 .
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          http://jenkins-ci.org/commit/copyartifact-plugin/0af073471b7b630e6e3b9ca8e8984fd2bf2f9afa
          Log:
          [FIXED JENKINS-18804] Fixed NPE on TriggeredBuildSelector when the upstream is removed.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java http://jenkins-ci.org/commit/copyartifact-plugin/0af073471b7b630e6e3b9ca8e8984fd2bf2f9afa Log: [FIXED JENKINS-18804] Fixed NPE on TriggeredBuildSelector when the upstream is removed.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java
          src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java
          src/test/java/hudson/plugins/copyartifact/testutils/RemoveUpstreamBuilder.java
          http://jenkins-ci.org/commit/copyartifact-plugin/22eb37c9763a1a67ebd199dbe507edabfc190068
          Log:
          Merge pull request #46 from ikedam/feature/JENKINS-18804_FixNPEonTriggeredBuildSelector

          JENKINS-18804 Fix NPE in TriggeredBuildSelector

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/9f7f31b6bfec...22eb37c9763a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java src/test/java/hudson/plugins/copyartifact/TriggeredBuildSelectorTest.java src/test/java/hudson/plugins/copyartifact/testutils/RemoveUpstreamBuilder.java http://jenkins-ci.org/commit/copyartifact-plugin/22eb37c9763a1a67ebd199dbe507edabfc190068 Log: Merge pull request #46 from ikedam/feature/ JENKINS-18804 _FixNPEonTriggeredBuildSelector JENKINS-18804 Fix NPE in TriggeredBuildSelector Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/9f7f31b6bfec...22eb37c9763a
          Hide
          ikedam ikedam added a comment -

          Fixed in 1.32

          Show
          ikedam ikedam added a comment - Fixed in 1.32

            People

            • Assignee:
              ikedam ikedam
              Reporter:
              yamoinca yamoinca
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: