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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • copyartifact-plugin
    • None
    • Linux

      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
      

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

              Created:
              Updated:
              Resolved: