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

Use of file parameter crashes Jenkins jobs sometimes

XMLWordPrintable

      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.

            Unassigned Unassigned
            colinjenkins16 Colin Ward
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: