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

Archiving artifacts does not preserve timestamps if archived on master

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Windows 7, Java 1.8, Jenkins 1.575
      Linux 64, Java 1.8, Jenkins 1.647

      When a build run on the master, "Archive the artifacts" doesn't preserve timestamps.
      It preserves timestamps when run on slaves.

      It looks caused by FilePath.copyRecursiveTo.


      Original description (the issue was found not of Copyartifact, but of ArtifactArchiver):

      The timestamps of artifacts are not preserved when archiving artifacts, OR performing a CopyArtifact operation if the artifact filter is set to "**".

      For example the filter

      "myfolder\**"

      will preserve timestamps.

      We use mutiple chained Jenkins jobs to perform a build. If the timestamps of dependency files in the artifact passed between jobs is not preserved, then subsequent jobs will fail.

          [JENKINS-23645] Archiving artifacts does not preserve timestamps if archived on master

          Timmy Brolin created issue -

          Timmy Brolin added a comment -

          Backslashes were removed by JIRA formatting?
          Note that: "myfolder**" mentioned above is supposed to be "myfolder backslash asterisk asterisk"

          Timmy Brolin added a comment - Backslashes were removed by JIRA formatting? Note that: "myfolder**" mentioned above is supposed to be "myfolder backslash asterisk asterisk"
          Timmy Brolin made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: copyarchiver [ 15676 ]
          Johannes Schmieder made changes -
          Description Original: The timestamps of artifacts are not preserved when archiving artifacts, OR performing a CopyArtifact operation if the artifact filter is set to "**".

          For example the filter "myfolder\**" will preserve timestamps.

          We use mutiple chained Jenkins jobs to perform a build. If the timestamps of dependency files in the artifact passed between jobs is not preserved, then subsequent jobs will fail.
          New: The timestamps of artifacts are not preserved when archiving artifacts, OR performing a CopyArtifact operation if the artifact filter is set to "**".

          For example the filter <code>"myfolder\**"</code> will preserve timestamps.

          We use mutiple chained Jenkins jobs to perform a build. If the timestamps of dependency files in the artifact passed between jobs is not preserved, then subsequent jobs will fail.
          Johannes Schmieder made changes -
          Description Original: The timestamps of artifacts are not preserved when archiving artifacts, OR performing a CopyArtifact operation if the artifact filter is set to "**".

          For example the filter <code>"myfolder\**"</code> will preserve timestamps.

          We use mutiple chained Jenkins jobs to perform a build. If the timestamps of dependency files in the artifact passed between jobs is not preserved, then subsequent jobs will fail.
          New: The timestamps of artifacts are not preserved when archiving artifacts, OR performing a CopyArtifact operation if the artifact filter is set to "**".

          For example the filter {code}"myfolder\**"{code} will preserve timestamps.

          We use mutiple chained Jenkins jobs to perform a build. If the timestamps of dependency files in the artifact passed between jobs is not preserved, then subsequent jobs will fail.

          ikedam added a comment -

          Please report your versions of Java, Jenkins, and copyartifact plugin.
          It is a known issue that timestamps are not preserved in Winsows. It is rather a limitation of Java on Windows. (see JENKINS-11073, JENKINS-13515).

          If you use Java <= 1.6, please try Java 1.7 (and the latest LTE version of Jenkins) and see the problem reproduces.

          But I'm not sure why the filter affects the behavior.
          You'd better check the owner and permissions of the workspace folder of that job. Jenkins might fail to change the attributes of files directly under the workspace folder for its permission.

          ikedam added a comment - Please report your versions of Java, Jenkins, and copyartifact plugin. It is a known issue that timestamps are not preserved in Winsows. It is rather a limitation of Java on Windows. (see JENKINS-11073 , JENKINS-13515 ). If you use Java <= 1.6, please try Java 1.7 (and the latest LTE version of Jenkins) and see the problem reproduces. But I'm not sure why the filter affects the behavior. You'd better check the owner and permissions of the workspace folder of that job. Jenkins might fail to change the attributes of files directly under the workspace folder for its permission.

          Timmy Brolin added a comment - - edited

          I was using java 1.6. Have now upgraded to 1.8. Makes no difference.
          Currently using Jenkins version 1.565. Will look into upgrading to the latest version tomorrow.
          CopyArtefact is version 1.31

          I have however noticed the following:
          My setup is a 32bit windows 7 Jenkins master, and a 64bit windows 7 Jenkins slave.
          I run a multi-configuration job, and archive the results from all configurations.

          After the job is done, I manually check the archive folders in the jenkins master.
          The timestamps for the configurations that ran on the slave are fine. It is only the timestamps for the configurations that ran in the master which are incorrect.

          So the problem seems to be connected to running on 32bit windows, or to jobs running on the jenkins master...

          Timmy Brolin added a comment - - edited I was using java 1.6. Have now upgraded to 1.8. Makes no difference. Currently using Jenkins version 1.565. Will look into upgrading to the latest version tomorrow. CopyArtefact is version 1.31 I have however noticed the following: My setup is a 32bit windows 7 Jenkins master, and a 64bit windows 7 Jenkins slave. I run a multi-configuration job, and archive the results from all configurations. After the job is done, I manually check the archive folders in the jenkins master. The timestamps for the configurations that ran on the slave are fine. It is only the timestamps for the configurations that ran in the master which are incorrect. So the problem seems to be connected to running on 32bit windows, or to jobs running on the jenkins master...

          Daniel Beck added a comment -

          Makes sense. FilePath.copyRecursiveTo(DirScanner,FilePath,String) behaves differently when it's a master local copy: In that case, it simply copies the files over using IOUtils.mkdirs/Util.copyFile (which in turn uses org.apache.tools.ant.taskdefs.Copy without preservelastmodified). In the remote case, it creates a Tar archive and transfers it over the remoting channel, extracting on the master.

          Daniel Beck added a comment - Makes sense. FilePath.copyRecursiveTo(DirScanner,FilePath,String) behaves differently when it's a master local copy: In that case, it simply copies the files over using IOUtils.mkdirs/Util.copyFile (which in turn uses org.apache.tools.ant.taskdefs.Copy without preservelastmodified). In the remote case, it creates a Tar archive and transfers it over the remoting channel, extracting on the master.

          Daniel Beck added a comment -

          Seems unrelated to CopyArtifact.

          Daniel Beck added a comment - Seems unrelated to CopyArtifact.
          Daniel Beck made changes -
          Component/s Original: copyartifact [ 15692 ]

            Unassigned Unassigned
            tib Timmy Brolin
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: