-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Powered by SuggestiMate
Hi,
I'm using pipeline-maven-plugin 3.0.1, with Jenkins (CLI I think) 2.85. For Freestyle jobs, when using Invoke top-level Maven targets, it's successful without any error/issue came up. However, when using withMaven in Declarative Pipeline, the issue of java.lang.IllegalArgumentException: Cannot relativize 'path' relatively to 'another_path' occurred.
I tried to use either -f 'path_to_pom.xml_file'**, or dir("${WORKSPACE}"), the issue was resolved in release:prepare step. Then in release:perform step, the artifacts/packages were uploaded to Nexus, and the build was successful, but the errors still occurred.
- relates to
-
JENKINS-46084 "IllegalArgumentException : Cannot relativize '...' relatively to ...'" with symlinks
-
- Closed
-
[JENKINS-63632] Cannot relativize '...' relatively to '...' in pipeline maven plugin 3.0.1
Hi Nhan,
It might be great if you could paste the logs instead of a screenshot (easier to copy/paste).
As far as I can see the JUnit publisher is failing to retrieve the reports from the project because it tries to compute a relative path between `/var/lib/jenkins/workspace/IS-....` and `/data02/IS-...`
Do you have a symbolic link between these folders ?
Which version of Jenkins are you using ? Did you configure a custom workspace folder ? (it's something which was possible in the past but we removed it for this king of issue - it can always be done with system properties).
The best option is to use a specific mount at the FS level instead of a link.
Also are you really using the version 3.0.1 ( https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.0.1 ) released 2.5y ago ?
The codebase changed a lot and it might be great if you could reproduce the issue on a more recent version.
Cheers
Hi Arnaud,
Sorry for the screenshot. Anyways, I cannot really check if I have a symbolic link between those folders since I don't have the privilege to the VMs, which are hosting the Jenkins.
The version of Jenkins is 2.85, and I believe it's a Jenkins CLI thing. Don't be surprise of the old version . My project is using super old version of Jenkins and plugins, that's why I'm using pipeline-maven plugin 3.0.1.
Let's jump to the trial I did.
After adding some additional options for withMaven(), it turned out the issue was resolved. I also tried to remove dir() or -f ./pom.xml as well, they all worked with only the additional options.
Here's some of the log where it failed at release:perform
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine:pom:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/pom.xml}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/pom.xml' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:80)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-common:pom:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/calculation-engine-common/pom.xml}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/calculation-engine-common/pom.xml' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:80)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-common:jar:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/calculation-engine-common/target/calculation-engine-common-100.5.813-NHN.jar}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/calculation-engine-common/target/calculation-engine-common-100.5.813-NHN.jar' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:95)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-api:pom:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/api/pom.xml}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/api/pom.xml' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:80)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-api:jar:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/api/target/calculation-engine-api-100.5.813-NHN.jar}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/api/target/calculation-engine-api-100.5.813-NHN.jar' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:95)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-opa-integration:pom:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/opa-integration/pom.xml}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/opa-integration/pom.xml' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:80)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
ERROR: [withMaven] artifactsPublisher - WARNING: Exception archiving and fingerprinting MavenArtifact{dk.rim.is:calculation-engine-opa-integration:jar:100.5.813-NHN(version: 100.5.813-NHN, snapshot:false) /data02/IS-72660_generic_pipeline/opa-integration/target/calculation-engine-opa-integration-100.5.813-NHN.jar}, skip archiving of the artifacts
java.lang.IllegalArgumentException: Cannot relativize '/data02/IS-72660_generic_pipeline/opa-integration/target/calculation-engine-opa-integration-100.5.813-NHN.jar' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
{{ at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:319)}}
{{ at org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher.process(GeneratedArtifactsPublisher.java:95)}}
{{ at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)}}
{{ at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)}}
{{ at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onFailure(BodyExecutionCallback.java:124)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:345)}}
{{ at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)}}
{{ at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)}}
{{ at com.cloudbees.groovy.cps.Next.step(Next.java:83)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)}}
{{ at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)}}
{{ at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)}}
{{ at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)}}
{{ at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)}}
{{ at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)}}
{{ at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)}}
{{ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
{{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
{{ at java.lang.Thread.run(Thread.java:748)}}
> Sorry for the screenshot.
No worries
> Anyways, I cannot really check if I have a symbolic link between those folders since I don't have the privilege to the VMs, which are hosting the Jenkins.
Crap, it's annoying. I will do some tests but i am pretty sure that it's something like this.
Even if it's not a very good practice I prefer to keep your bug report open, I don't think that the plugin should fail like this.
The version of Jenkins is 2.85, and I believe it's a Jenkins CLI thing. Don't be surprise of the old version . My project is using super old version of Jenkins and plugins, that's why I'm using pipeline-maven plugin 3.0.1.
I understand that too much ...
> Let's jump to the trial I did.
> After adding some additional options for withMaven(), it turned out the issue was resolved. I also tried to remove dir() or -f ./pom.xml as well, they all worked with only the additional options.
> Here's some of the log where it failed at release:perform
These additional stacktraces are helping a lot
In fact all publishers (it was JUnit in the screenshot, artifactsPublisher here) are calling XmlUtils.getPathInWorkspace
Thus they all have the same bug.
Looking at the code history it seems that cleclerc tried to fix it in the version 3.0.0 (ref JENKINS-46084) but in your case the fix isn't working
The verification is done based on the /workspace/ folder which has to be found in both paths.
In the test we have
String workspace = "/var/lib/jenkins/workspace/testjob"; String absolutePath = "/app/Jenkins/home/workspace/testjob/pom.xml";
But in your environment you have something like
String workspace = "/var/lib/jenkins/workspace/IS-72660_generic_pipeline"; String absolutePath = "/data02/IS-72660_generic_pipeline/pom.xml";
And the "hack" used for JENKINS-46084 doesn't work because in the absolute path you don't have a 'workspace' folder.
That's why I would love to understand how the server was configured (But I think that my idea of using symlink should be conform to what we see).
That's why you get the error :
Cannot relativize '/data02/IS-72660_generic_pipeline/pom.xml' relatively to '/var/lib/jenkins/workspace/IS-72660_generic_pipeline'
The workaround like you did is to disable the publishers for now.
I think the bug is reproducible and I could work on a fix with what you provided.
I just have to check with others developers if there is a "right" way to this in Jenkins today (it maybe evolved since Cyrille introduced it)
Any idea fbelzunc, allan_burdajewicz, pierrebtz ?
Hey Arnaud,
Thanks for the interpretation, that's awesome. I'm not sure about the absolutePath as the data02 folder sounds like a name of a folder of a VM, where it holds the Jenkins machine that I was using to run the pipeline - master I believe. However, since I cannot access to it, I cannot confirm if that's 100% correct. Let's wait for other people's opinion.
For some reason we expect the absoluteFilePath to contain workspace/ in the case of symlinks:
- https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.9.3/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L353
- https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.9.3/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L359
I think that the challenge here is that we try to relativize remote path locally to save a Remoting call. If this was executed in remote, you could probably just use Paths.relativize. I don't see how we can handle symlinks reliably without doing a remote call (a la FilePath.actAsync).
- Is a remote call that costly ? We could maybe rely on a remote call as last resort then ? Fixing this problem at the cost of performance in case of those symlinks scenarios.
I am not familiar with the functional aspect here but:
- Is this method hit a lot ?
- Shouldn't the absoluteFilePath passed to this method be the path in the workspace ? For example in this case, should we really pass the resolved link /data02/IS-72660_generic_pipeline/pom.xml and not /var/lib/jenkins/workspace/IS-72660_generic_pipeline/pom.xml ?
Since "// withMaven will discover the generated Maven artifacts, JUnit Surefire & FailSafe & FindBugs & SpotBugs reports...", I tried to disable some options: [artifactsPublisher(disabled: true)], and junitPublisher(disabled: true). Only some info occurred.
Can someone please explain what actually happened?