Status: Closed (View Workflow)
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/**`
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
JENKINS-20546 Preserve symlinks when copying artifacts
Ingo: Did you recently update to 1.554 or higher, which includes the fix to
Daniel: Sorry, I haven't gotten any notification on this update. Yes, I have updated to a more recent version. That's what I usually do to keep up with improvements and fixes to Jenkins.
Today I started to investigate a build failure and it's exactly this issue.
My current setup is a Matrix job that runs on OSX and Windows. The job fails only on OSX when trying to copy the archived artifacts.
I ran into this issue a couple of days ago, when a job suddenly started to fail.
Does anybody know what has changed in this particular area that causes this feature not to work properly anymore? I'm curious how symbolic links have been handled before.