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

Use of file parameter crashes Jenkins jobs sometimes

    Details

    • Similar Issues:

      Description

      In all of our Jenkins jobs we have a file parameter that can be passed in. The file is always called "buildspec.txt" and contains information useful for our build tool. This file parameter is optional.

      99% of time this works perfectly but sometimes when triggering a build, Jenkins crashes when trying to copy the file. This is when the file has not been passed in. If I try doing the build again after the crash (again, without passing in any file) then it works. I get the following output on the build console:

      Copying file to buildspec.txt
      FATAL: java.lang.NullPointerException
      java.io.IOException: java.lang.NullPointerException
      at hudson.FilePath.copyFrom(FilePath.java:900)
      at hudson.model.FileParameterValue$2.setUp(FileParameterValue.java:147)
      at hudson.model.Build$BuildExecution.doRun(Build.java:154)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
      at hudson.model.Run.execute(Run.java:1745)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Caused by: java.lang.NullPointerException
      at hudson.FilePath.copyFrom(FilePath.java:896)
      ... 7 more

      We are using Jenkins 1.580.3. I have Googled and also searched your Jira but cannot find anyone else having this exact error.

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          From what I see null FileItem gets to the list.
          Most likely it's caused by the missing File item in the form submission (or by empty stream in it).

          Jenkins core should at least verify such cases.

          Show
          oleg_nenashev Oleg Nenashev added a comment - From what I see null FileItem gets to the list. Most likely it's caused by the missing File item in the form submission (or by empty stream in it). Jenkins core should at least verify such cases.

            People

            • Assignee:
              Unassigned
              Reporter:
              colinjenkins16 Colin Ward
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: