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

Invalid symbolic links get archived but cannot be copied using Copy Artifacts




      The copyartifact plugin fails to properly handle symlinks from a slave machine. When you create the symlink and archive it, the symlink returns a 404, and anything that tries to Copy Archive from the above project throws an exception.

      Steps to reproduce:
      Create a SLAVE NODE on a linux instance
      Create a Job (fooProject) that has `Execute ssh` with the following

      mkdir -p foo 
      echo $BUILD_TAG > foo/bar 
      ln -s $( readlink -f foo/bar ) foo/baz

      Then Archive the Artifacts on `foo/**`
      Execute job
      Create a new project (barProject)
      Copy artifacts from project (fooProject)
      Execute and you will receive the following stack trace below:

      ERROR: Failed to copy artifacts from tets with filter: **
      hudson.util.IOException2: Failed to copy /Users/Shared/Jenkins/Home/jobs/tets/builds/2014-03-31_17-56-04/archive/foo/baz to /tmp/workspace/tets2/foo/baz
      	at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyOne(FingerprintingCopyMethod.java:107)
      	at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyAll(FingerprintingCopyMethod.java:68)
      	at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:368)
      	at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:306)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781)
      	at hudson.model.Build$BuildExecution.build(Build.java:199)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
      	at hudson.model.Run.execute(Run.java:1665)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:246)
      Caused by: java.io.FileNotFoundException: /Users/Shared/Jenkins/Home/jobs/tets/builds/2014-03-31_17-56-04/archive/foo/baz (No such file or directory)
      	at java.io.FileInputStream.open(Native Method)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at hudson.FilePath$34.invoke(FilePath.java:1797)
      	at hudson.FilePath$34.invoke(FilePath.java:1792)
      	at hudson.FilePath.act(FilePath.java:916)
      	at hudson.FilePath.act(FilePath.java:889)
      	at hudson.FilePath.copyTo(FilePath.java:1792)
      	at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyOne(FingerprintingCopyMethod.java:79)
      	... 12 more
      Build step 'Copy artifacts from another project' marked build as failure
      Finished: FAILURE


        Issue Links


            schristou Steven Christou created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue duplicates JENKINS-20546 [ JENKINS-20546 ]
            jglick Jesse Glick made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            ikedam ikedam made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 154554 ] JNJira + In-Review [ 207580 ]


              Unassigned Unassigned
              schristou Steven Christou
              2 Vote for this issue
              3 Start watching this issue