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

FileParameter causes Null pointer exception in triggered parametrized job

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If Job A takes a parameter of File type and Job A triggers parameterized Job B, Hudson fails to set up job B with a NullPointerException in
      FATAL: null
      java.lang.NullPointerException
      at hudson.model.FileParameterValue$1.setUp(FileParameterValue.java:83)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:132)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
      at hudson.model.Run.run(Run.java:1241)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:122)
      even if job B does not take any file parameters.

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          Here's the problem:
          1. Job A runs as uses its file parameter.. code in setUp sets its file field to null after it is read.
          2. Parameterized trigger gives the params from Job A to Job B
          3. When setUp runs for Job B, it gets NPE because the file field is now null.

          Easy enough to simply avoid NPE and do nothing here.. but is that the right solution? Job B will still show this parameter in the "Parameters" info for that build, but the file wasn't really there.
          Ideas welcome here..

          Show
          mindless Alan Harder added a comment - Here's the problem: 1. Job A runs as uses its file parameter.. code in setUp sets its file field to null after it is read. 2. Parameterized trigger gives the params from Job A to Job B 3. When setUp runs for Job B, it gets NPE because the file field is now null. Easy enough to simply avoid NPE and do nothing here.. but is that the right solution? Job B will still show this parameter in the "Parameters" info for that build, but the file wasn't really there. Ideas welcome here..
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/parameterized-trigger/src/main/java/hudson/plugins/parameterizedtrigger/CurrentBuildParameters.java
          trunk/hudson/plugins/parameterized-trigger/src/main/resources/hudson/plugins/parameterizedtrigger/CurrentBuildParameters/config.jelly
          trunk/hudson/plugins/parameterized-trigger/src/main/webapp/help/current.html
          http://jenkins-ci.org/commit/33345
          Log:
          [parameterized-trigger] [FIXED JENKINS-6777] File parameters are not reusable
          (results in NPE), so omit these in CurrentBuildParameters. Note this in help text.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/parameterized-trigger/src/main/java/hudson/plugins/parameterizedtrigger/CurrentBuildParameters.java trunk/hudson/plugins/parameterized-trigger/src/main/resources/hudson/plugins/parameterizedtrigger/CurrentBuildParameters/config.jelly trunk/hudson/plugins/parameterized-trigger/src/main/webapp/help/current.html http://jenkins-ci.org/commit/33345 Log: [parameterized-trigger] [FIXED JENKINS-6777] File parameters are not reusable (results in NPE), so omit these in CurrentBuildParameters. Note this in help text.

            People

            • Assignee:
              mindless Alan Harder
              Reporter:
              cszabo1 cszabo1
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: