Hi Erez Arbell - Thanks for all your help. I have been able to reproduce the problem with the following setup: (1) Submit //depot/lib_autoload/libs/src/com/f/v/Utils.groovy
#!groovy
package com.f.v
class Utils implements Serializable {
static void main()
{
println("This is in Utils Library")
}
static void test()
{
println("This is test in Utils in the Library")
}
}
(2) Define a pipeline job with groovy code in GUI editor:
// Define globals
def fLibts{
try {
node ('master') {
Lib = loadFLib()
def buildData = Lib.com.f.v.Utils.test();
}
}
catch (e) {
throw e
}
echo "Running some tests here..."
}// Load a specific Library
def loadFLib() {
def p4ClientFormat = "jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-flib"
return loadLibrary(
identifier: 'f@1',
clientFormat: p4ClientFormat,
p4Mapping: "//depot/lib_autoload/libs/src/com/f/v/... //${p4ClientFormat}/src/com/f/v/...\n"
)
}// Generic Library Loader
def loadLibrary(args)
{
def lib = library(
identifier: args.identifier,
retriever: legacySCM([
$class: 'PerforceScm',
credential: 'JenkinsMaster',
populate: [
$class: 'AutoCleanImpl',
delete: true,
modtime: false,
pin: '',
quiet: false,
replace: true
],
workspace: manualSpec(
charset: 'none',
name: args.clientFormat,
pinHost: false,
spec: clientSpec(
allwrite: false, backup: false, clobber: true, compress: false, line: 'LOCAL',
locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE',
view: args.p4Mapping
)
)
])
)
return lib
}
(3) Run the job. (4) When you use the 'Replay' option for the same job you see:
11:21:41 P4: saving built changes.
11:21:41 ... p4 client -o jenkins-master-JENKINS-57314-ExplicitLocalLib-Replay-2-flib
+11:21:41 ... p4 info
+11:21:41 ... p4 info
+11:21:41 ... p4 client -o jenkins-master-JENKINS-57314-ExplicitLocalLib-Replay-2-flib
+11:21:41 ... done
11:21:41
11:21:41 Replacing contents of src/com/f/v/Utils.groovy
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] End of Pipeline
java.nio.file.AccessDeniedException: /var/lib/jenkins/jobs/JENKINS-57314-ExplicitLocalLib-Replay/builds/25/libs/f/src/com/f/v/Utils.groovy
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
at java.nio.file.Files.newOutputStream(Files.java:216)
at hudson.FilePath$Write.invoke(FilePath.java:2100)
at hudson.FilePath$Write.invoke(FilePath.java:2089)
at hudson.FilePath.act(FilePath.java:1076)
at hudson.FilePath.act(FilePath.java:1059)
at hudson.FilePath.write(FilePath.java:2087)
at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:168)
at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:207)
at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:156)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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)
Finished: FAILURE
|