• Icon: Task Task
    • Resolution: Not A Defect
    • Icon: Major Major
    • Ubuntu Linux 18.04
      Java openjdk version 11.0.14
      Jenkins version 2.332.1
      Parameterized Trigger plugin version 2.44

      All jobs that finish successfully and trigger a call to another Jenkins job with the Parameterized Trigger plugin fail with a NullPointerException. All these triggers had previously been working. The stack trace is below.

       

      ERROR: Failed to build parameters to trigger project: Test-Config-Deploy
      java.lang.NullPointerException
      at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
      at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
      at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
      at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
      at hudson.plugins.global_variable_string_parameter.GlobalVariableStringParameterDefinition.replaceGlobalVars(GlobalVariableStringParameterDefinition.java:132)
      at hudson.plugins.global_variable_string_parameter.GlobalVariableStringParameterDefinition.getDefaultParameterValue(GlobalVariableStringParameterDefinition.java:84)
      at hudson.plugins.global_variable_string_parameter.GlobalVariableStringParameterDefinition.getDefaultParameterValue(GlobalVariableStringParameterDefinition.java:53)
      at hudson.plugins.parameterizedtrigger.DefaultParameterValuesActionsTransform.getDefaultParameters(DefaultParameterValuesActionsTransform.java:28)
      at hudson.plugins.parameterizedtrigger.DefaultParameterValuesActionsTransform.transformParametersAction(DefaultParameterValuesActionsTransform.java:15)
      at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
      at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:378)
      at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:64)
      at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:272)
      at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:716)
      at hudson.model.Build$BuildExecution.cleanUp(Build.java:193)
      at hudson.model.Run.execute(Run.java:1935)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:99)
      at hudson.model.Executor.run(Executor.java:432)
      Finished: SUCCESS

          [JENKINS-68130] NullPointerException in Paramererized Trigger Plugin

          The stack trace refers to the Global Variable String Parameter plugin, as well. I assume you are using the latest version 1.2 of that, because it was released nine years ago.

          GlobalVariableStringParameterDefinition.java:132 in the stack trace indicates that String str is null. This value comes from super.getDefaultValue(), which is set from the String defaultValue parameter of the GlobalVariableStringParameterDefinition constructor.

          DefaultParameterValuesActionsTransform.java:28 calls getDefaultParameterValue() on a ParameterDefinition that it has got from ParametersDefinitionProperty.

          Can you show the ParametersDefinitionProperty from the config.xml of the job?

          Kalle Niemitalo added a comment - The stack trace refers to the Global Variable String Parameter plugin, as well. I assume you are using the latest version 1.2 of that, because it was released nine years ago. GlobalVariableStringParameterDefinition.java:132 in the stack trace indicates that String str is null. This value comes from super.getDefaultValue() , which is set from the String defaultValue parameter of the GlobalVariableStringParameterDefinition constructor. DefaultParameterValuesActionsTransform.java:28 calls getDefaultParameterValue() on a ParameterDefinition that it has got from ParametersDefinitionProperty. Can you show the ParametersDefinitionProperty from the config.xml of the job?

          Todd Allen added a comment -

          You're absolutely right. The problem was on the triggered job and not the triggering job. A default value was added on the triggered job and the error went away.

          Thank you for pointing me in the right direction!

           

          Todd Allen added a comment - You're absolutely right. The problem was on the triggered job and not the triggering job. A default value was added on the triggered job and the error went away. Thank you for pointing me in the right direction!  

          Todd Allen added a comment -

          A default value is required for the global parameter value. This may or may not be a defect but it's easy to work around.

          Todd Allen added a comment - A default value is required for the global parameter value. This may or may not be a defect but it's easy to work around.

            Unassigned Unassigned
            hcdjenkins Todd Allen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: