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

Parameterized Trigger Plugin Dynamic downstream projects fails "array out of bounds"

    Details

    • Similar Issues:

      Description

      I am using using Active choice plugin for fetching job list:

       

      def choices=[:]
      jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
       println "Folder - ${folder}"
       folder.getItems().each {
       println "${it.name}"
       choices.put(folder.name+'/'+it.name, it.name)
       } 
      }
      return choices
      

       

      Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

       

      Post build action: Trigger parameterized build on othern projects.
      Projects to build: ${JOBS}
      

       

      Variable JOBS looks like

      JOBS=DEV/Build,DEV/Test,DEV/Deploy

       

      Exception raised then parameterized plugin iterates over variable:

      java.lang.ArrayIndexOutOfBoundsException: 1
       at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
       at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
       at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
       at hudson.model.Run.execute(Run.java:1774)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)

      Problem is in cycle
      In my scenario:

      String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
       String[] vars = ["$JOBS]

      Iterating over vars is not possible, but upstream jobs still executed.

      Maybe something like: if ((vars.length == 1 ? vars[0] : vars[i]).trim().contains("$")) {

        Attachments

          Activity

          xerxes9000sx Konstantin Erokhin created issue -
          xerxes9000sx Konstantin Erokhin made changes -
          Field Original Value New Value
          Description I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          java.lang.ArrayIndexOutOfBoundsException: 1
          at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
          at hudson.model.Run.execute(Run.java:1774)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)

          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
          In my scenario:
          String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
          String[] vars = ["$JOB]
          Iterating over vars is not possible.
          I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOB]
           Iterating over vars is not possible.
          xerxes9000sx Konstantin Erokhin made changes -
          Description I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOB]
           Iterating over vars is not possible.
          I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOBS]
           Iterating over vars is not possible.
          xerxes9000sx Konstantin Erokhin made changes -
          Description I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOBS]
           Iterating over vars is not possible.
          I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOBS]
           Iterating over vars is not possible, but upstream jobs still executed.
          xerxes9000sx Konstantin Erokhin made changes -
          Description I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
           String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOBS]
           Iterating over vars is not possible, but upstream jobs still executed.
          I am using using Active choice plugin for fetching job list:

           
          {code:java}
          def choices=[:]
          jenkins.model.Jenkins.instance?.getAllItems(com.cloudbees.hudson.plugins.folder.Folder).each { folder ->
           println "Folder - ${folder}"
           folder.getItems().each {
           println "${it.name}"
           choices.put(folder.name+'/'+it.name, it.name)
           }
          }
          return choices
          {code}
           

          Result saved in variable JOBS, and then passed to Parameterized trigger plugin in post-build actions.

           
          {code:java}
          Post build action: Trigger parameterized build on othern projects.
          Projects to build: ${JOBS}
          {code}
           

          Variable JOBS looks like
          {noformat}
          JOBS=DEV/Build,DEV/Test,DEV/Deploy{noformat}
           

          Exception raised then parameterized plugin iterates over variable:
          {code:java}
          java.lang.ArrayIndexOutOfBoundsException: 1
           at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:128)
           at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
           at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
           at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
           at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
           at hudson.model.Run.execute(Run.java:1774)
           at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429){code}
          Problem is in [cycle|https://github.com/jenkinsci/parameterized-trigger-plugin/blob/master/src/main/java/hudson/plugins/parameterizedtrigger/BuildTrigger.java#L122]
           In my scenario:
          {code:java}
          String[] projects = ["DEV/Build", "DEV/Test", "DEV/Deploy"]
           String[] vars = ["$JOBS]{code}

           Iterating over vars is not possible, but upstream jobs still executed.

          Maybe something like: if ((vars.length == 1 ? vars[0] : vars[i]).trim().contains("$")) \{

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              xerxes9000sx Konstantin Erokhin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: