Question

This configuration worked when the build master was running Ubuntu 13.04. Since upgrading the build master to Ubuntu 13.10, with Jenkins 1.509.2, the Ubuntu 12.04 build slaves fail during the archiving artifacts step. I searched on Google and checked the Debian BTS and Launchpad but haven't found any mention of this error.

Archiving artifacts
ERROR: Failed to archive artifacts: **/*
hudson.util.IOException2: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.StringBuffer
        at hudson.FilePath.copyRecursiveTo(FilePath.java:1942)
        at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:137)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724)
        at hudson.model.Run.execute(Run.java:1600)
        at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:237)
Caused by: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.StringBuffer
        at hudson.remoting.Channel$4.adapt(Channel.java:704)
        at hudson.remoting.Channel$4.adapt(Channel.java:699)
        at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
        at hudson.FilePath.copyRecursiveTo(FilePath.java:1940)
        ... 10 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.StringBuffer
        at hudson.util.io.TarArchiver.visitSymlink(TarArchiver.java:79)
        at hudson.util.DirScanner$Glob.scan(DirScanner.java:126)
        at hudson.FilePath.writeToTar(FilePath.java:1978)
        at hudson.FilePath.access$1000(FilePath.java:168)
        at hudson.FilePath$36.invoke(FilePath.java:1919)
        at hudson.FilePath$36.invoke(FilePath.java:1915)
        at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:326)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Build step 'Archive the artifacts' changed build result to FAILURE

No correct solution

OTHER TIPS

I determined that the crash occurs only when the workspace contains a symbolic link. As a workaround, I added to my ("execute shell") build step removal of all symlinks before jenkins proceeds to archive the workspace.

#
# Workaround Jenkins bug:
#
# Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.StringBuffer
#   at hudson.util.io.TarArchiver.visitSymlink(TarArchiver.java:79)
#
find . -type l -print0 | xargs -0 rm -f
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top