-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins 2.303.3
workflow-cps-global-lib: 564.ve62a_4eb_b_e039
pipeline output:
Started by user ... Rebuilds build #103 Resume disabled by user, switching to high-performance, low-durability mode. Loading library lib@master Library lib@master is cached. Copying from home. [Pipeline] Start of Pipeline [Pipeline] libraryResource [Pipeline] End of Pipeline ERROR: /internal/html/dashboard.css references a file that is not contained within the library: lib Finished: FAILURE
stacktrace:
hudson.AbortException: /internal/html/dashboard.css references a file that is not contained within the library: lib at org.jenkinsci.plugins.workflow.libs.LibraryAdder.findResources(LibraryAdder.java:260) at org.jenkinsci.plugins.workflow.libs.ResourceStep$Execution.run(ResourceStep.java:94) at org.jenkinsci.plugins.workflow.libs.ResourceStep$Execution.run(ResourceStep.java:86) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:41) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:319) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:193) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20) at obfuscated.PipelineResources.loadResources(PipelineResources.groovy:17) at testingPipeline.call(testingPipeline.groovy:317) at WorkflowScript.run(WorkflowScript:240)
I added some logging to https://github.com/jenkinsci/workflow-cps-global-lib-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryAdder.java#L248-L268
There is some issue with
if (!new File(f.getRemote()).getCanonicalFile().toPath().startsWith(new File(libResources.getRemote()).getCanonicalPath())) // // new File(f.getRemote()).getCanonicalFile().toPath() returns "/internal/html/dashboard.css" // libResources.getRemote()).getCanonicalPath() returns "/var/lib/jenkins/jobs/test/builds/2/libs"