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

File parameter builds started via the web interface fail when the file is copied into a workspace subdirectory.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Hudson 1.363

      To reproduce:

      • Create a build with a file parameter. Set the file location to be under a subdirectory of the workspace, i.e. "dir/fileParam".
      • Start a build through the web interface and provide a file.
      • The following stack trace appears in the build console output:
      Copying file to dir/fileParam
      FATAL: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
      java.io.FileNotFoundException: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(Unknown Source)
      	at java.io.FileOutputStream.<init>(Unknown Source)
      	at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:416)
      	at hudson.FilePath.copyFrom(FilePath.java:690)
      	at hudson.model.FileParameterValue$1.setUp(FileParameterValue.java:85)
      	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:124)
      

      The build is successful if the file is provided via the CLI, since the DiskFileItem class is not used in that case.

      It is also successful when the file location is directly under the workspace root directory.

          [JENKINS-6889] File parameter builds started via the web interface fail when the file is copied into a workspace subdirectory.

          Steven G Brown created issue -
          StevenGBrown made changes -
          Summary Original: File parameter builds started via the web interface fail when the file location is not the workspace root. New: File parameter builds started via the web interface fail when the file location is not directly under the workspace root.
          StevenGBrown made changes -
          Description Original: To reproduce:
          * Create a build with a file parameter. Set the file location to be under a subdirectory of the workspace, i.e. "dir/fileParam".
          * Start a build through the web interface and provide a file.
          * The following stack trace appears in the build console output:

          {noformat}
          Copying file to dir/fileParam
          FATAL: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
          java.io.FileNotFoundException: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:416)
          at hudson.FilePath.copyFrom(FilePath.java:690)
          at hudson.model.FileParameterValue$1.setUp(FileParameterValue.java:85)
          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:124)
          {noformat}

          However, this scenario will work if the file is provided via the CLI, since the {{DiskFileItem}} class is not used in that case.
          New: To reproduce:
          * Create a build with a file parameter. Set the file location to be under a subdirectory of the workspace, i.e. "dir/fileParam".
          * Start a build through the web interface and provide a file.
          * The following stack trace appears in the build console output:

          {noformat}
          Copying file to dir/fileParam
          FATAL: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
          java.io.FileNotFoundException: C:\Users\Steve\.hudson\jobs\test\workspace\dir\fileParam (The system cannot find the path specified)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at java.io.FileOutputStream.<init>(Unknown Source)
          at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:416)
          at hudson.FilePath.copyFrom(FilePath.java:690)
          at hudson.model.FileParameterValue$1.setUp(FileParameterValue.java:85)
          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:124)
          {noformat}

          The build is successful if the file is provided via the CLI, since the {{DiskFileItem}} class is not used in that case.

          It is also successful when the file location is directly under the workspace root directory.
          Summary Original: File parameter builds started via the web interface fail when the file location is not directly under the workspace root. New: File parameter builds started via the web interface fail when the file is copied into a workspace subdirectory.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Andrew Bayer made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          Jenkins IRC Bot made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: parameters [ 15594 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 136985 ] New: JNJira + In-Review [ 204319 ]

            stevengbrown Steven G Brown
            stevengbrown Steven G Brown
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: