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

Copy Artifact plugin incorrectly copies a non-latest build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Critical Critical
    • copyartifact-plugin, core
    • None
    • Jenkins 1.509.4 + Copy Artifact plugin 1.28 (and previously Jenkins 1.480.1 + Copy Artifact plugin 1.21)

      I've seen one instance where the Copy Artifact plugin (1.28) on 1.509.4 (LTS) inexplicably copied artifacts from the wrong build.

      (I have found only this one instance where this goes wrong, but it worries me a lot that something this basic can go wrong without any indication that something went wrong. Therefore I have set the priority to Critical.)

      The details follow; thanks for any and all help with this!


      We have configured a project X which results in an artifact, and a project Y which copies it from the 'last successful' build (with 'stable' checked).

      Chronologically the following happened:

      • In January, build 11 of project X ends in SUCCESS.
      • In March, build 12 of project X ends in SUCCESS.
      • In May, build 16 of project X ends in FAILURE.
        • Accidentally, build this failed with 'Copied 0 artifacts', which was probably correct, but may have been due to a Copy Artifact plugin bug.
      • No other builds for project X were kept after May.
      • In September, build 588 of project Y correctly copies the artifact from build 12.
      • In October, build 661 of project Y incorrectly copies the artifact from build 11.
      • Build 662 and following of project Y again correctly copy the artifact from build 12.

      I am sure that build 11 is chosen by (only) build 661 in two different ways: (1) the console log reports 'Copied 1 artifact from "X" build number 11'; and (2) the file fingerprints page for the build 11 artifacts point to build 661, while that for build 12 points to builds 588 and 662 and up.

      Inbetween build 588 and build 661, we upgraded Jenkins from 1.480.1 to 1.509.4, and the Copy Artifact plugin from 1.21 (which we still had because of JENKINS-11073) to 1.28. Up until build 588, the config XML looked like this:

      <hudson.plugins.copyartifact.CopyArtifact>
        <projectName>X</projectName>
        <filter>**/X.zip</filter>
        <target>some/path/in/workspace/of/Y</target>
        <selector class="hudson.plugins.copyartifact.StatusBuildSelector">
          <stable>true</stable>
        </selector>
        <flatten>true</flatten>
      </hudson.plugins.copyartifact.CopyArtifact>
      

      Currently, for build 661 and up, the config XML looks like this:

      <hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.28">
        <project>X</project>
        <filter>**/X.zip</filter>
        <target>some/path/in/workspace/of/Y</target>
        <selector class="hudson.plugins.copyartifact.StatusBuildSelector">
          <stable>true</stable>
        </selector>
        <flatten>true</flatten>
      </hudson.plugins.copyartifact.CopyArtifact>
      

      I see nothing strange in the console log for build 661, and also not in Jenkins's log files around the time of the incorrect copy.

      Finally, if it matters, all builds for project X were done on the same slave, while all builds for project Y were done on the master.

            Unassigned Unassigned
            marnix_klooster Marnix Klooster
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: