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

File parameter causing data lost after Jenkins restart

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Debian 2.6.32-5-amd

      Hi,

      We have encountered problems when using File parameter in our jobs.

      How to reproduce problem:
      1) create job
      2) mark "This build is parametrized"
      2a) Add Parameter - File Parameter
      2b) File location - "data.file"
      2c) description - "plik"
      3) Build
      3a) Add build step - Execute shell:
      ls -la
      mv data.file data.zip
      sleep 10
      rm *
      4) trigger new job and use big *.zip file as parameter (~150MB)

      During file upload on master in /tmp directory new file will be created - for example "upload_6e074d3b_136c03af218__8000_00000013.tmp".
      When job finish this *.tmp file usually is deleted automatically - and here our problems are starting.
      In build.xml additional note is added:
      <file class="org.apache.commons.fileupload.disk.DiskFileItem" serialization="custom">
      <org.apache.commons.fileupload.disk.DiskFileItem>
      <default>
      <isFormField>false</isFormField>
      <size>153052917</size>
      <sizeThreshold>10240</sizeThreshold>
      <contentType>application/zip</contentType>
      <dfosFile>/tmp/upload_6e074d3b_136c03af218__8000_00000013.tmp</dfosFile>
      <fieldName>file0</fieldName>
      <fileName>WN6.0_MP4.4_22.12.zip</fileName>
      </default>
      </org.apache.commons.fileupload.disk.DiskFileItem>
      </file>
      When we are restarting jenkins it is not able to read this jobs because this temporary file do not exists - job history is not visible from Jenkins but builds exists on machine. Error message after Jenkins restart:
      ...
      Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call org.apache.commons.fileupload.disk.DiskFileItem.readObject() : /tmp/upload_6e074d3b_136c03af218__8000_00000013.tmp (No such file or directory)
      ---- Debugging information ----
      message : Could not call org.apache.commons.fileupload.disk.DiskFileItem.readObject()
      cause-exception : java.io.FileNotFoundException
      cause-message : /tmp/upload_6e074d3b_136c03af218__8000_00000013.tmp (No such file or directory)
      class : hudson.model.FreeStyleBuild
      required-type : org.apache.commons.fileupload.disk.DiskFileItem
      path : /build/actions/hudson.model.ParametersAction/parameters/hudson.model.FileParameterValue/file/org.apache.commons.fileupload.disk.DiskFileItem
      line number : 32
      -------------------------------
      ...

      Could you please help to check this?

          [JENKINS-13536] File parameter causing data lost after Jenkins restart

          Blazej Mirowski created issue -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/hudson/model/ParametersDefinitionProperty.java
          http://jenkins-ci.org/commit/jenkins/c12df414eabda0721fdf6ceebdff09f6d99c238c
          Log:
          JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header.

          Compare: https://github.com/jenkinsci/jenkins/compare/7dff954...c12df41

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/model/ParametersDefinitionProperty.java http://jenkins-ci.org/commit/jenkins/c12df414eabda0721fdf6ceebdff09f6d99c238c Log: JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header. Compare: https://github.com/jenkinsci/jenkins/compare/7dff954...c12df41

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1689
          JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header. (Revision c12df414eabda0721fdf6ceebdff09f6d99c238c)

          Result = UNSTABLE
          Kohsuke Kawaguchi : c12df414eabda0721fdf6ceebdff09f6d99c238c
          Files :

          • core/src/main/java/hudson/model/ParametersDefinitionProperty.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1689 JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header. (Revision c12df414eabda0721fdf6ceebdff09f6d99c238c) Result = UNSTABLE Kohsuke Kawaguchi : c12df414eabda0721fdf6ceebdff09f6d99c238c Files : core/src/main/java/hudson/model/ParametersDefinitionProperty.java

          dogfood added a comment -

          Integrated in jenkins_ui-changes_branch #26
          JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header. (Revision c12df414eabda0721fdf6ceebdff09f6d99c238c)

          Result = SUCCESS
          Kohsuke Kawaguchi : c12df414eabda0721fdf6ceebdff09f6d99c238c
          Files :

          • core/src/main/java/hudson/model/ParametersDefinitionProperty.java

          dogfood added a comment - Integrated in jenkins_ui-changes_branch #26 JENKINS-13536 I think the proper thing to do is to use the Accept header, not the Content-Type header. (Revision c12df414eabda0721fdf6ceebdff09f6d99c238c) Result = SUCCESS Kohsuke Kawaguchi : c12df414eabda0721fdf6ceebdff09f6d99c238c Files : core/src/main/java/hudson/model/ParametersDefinitionProperty.java

          Hi,
          dogfood - so this correction is now included in official Jenkins release?

          Blazej Mirowski added a comment - Hi, dogfood - so this correction is now included in official Jenkins release?

          emwfrpr added a comment -

          Hi,
          Anyone working on this issue ?

          It is Urgent!

          emwfrpr added a comment - Hi, Anyone working on this issue ? It is Urgent!

          I need this also.

          Tomas Hellberg added a comment - I need this also.

          Still not working in 1.488.

          Tomas Hellberg added a comment - Still not working in 1.488.

          Same issue for me. Groovy Parametrized Builds. Working with Windows x64 Jenkins v1.488 (running as a service)

          Ioannis Moutsatsos added a comment - Same issue for me. Groovy Parametrized Builds. Working with Windows x64 Jenkins v1.488 (running as a service)

          Have noticed that the following 'hack' on the offending build.xml file will allow a 'Reload configuration from disk' operation to parse and load the missing build in the UI. Simply replace the offending <dfosFile> element with an empty <cachedContent> element.
          So in the original example above:
          replace
          <dfosFile>/tmp/upload_6e074d3b_136c03af218__8000_00000013.tmp</dfosFile>
          with
          <cachedContent></cachedContent>

          Ioannis Moutsatsos added a comment - Have noticed that the following 'hack' on the offending build.xml file will allow a 'Reload configuration from disk' operation to parse and load the missing build in the UI. Simply replace the offending <dfosFile> element with an empty <cachedContent> element. So in the original example above: replace <dfosFile>/tmp/upload_6e074d3b_136c03af218__8000_00000013.tmp</dfosFile> with <cachedContent></cachedContent>

            jglick Jesse Glick
            pasiu Blazej Mirowski
            Votes:
            4 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: