I have a pipeline script and encountered a strange groovy
error: java.io.NotSerializableException: org.codehaus.groovy.util.FastArray
I narrowed it down to an error in my script, namely that I had failed to
pass a value for a particular parameter.
Initially I thought it was to do with scripts in a global library, but the
problem is reproducible with a self contained script.
Is this a known bug?
Regards,
Connor
Here's the reproducible:
#!/usr/bin/env groovy
def sayHello() {
echo "Hello from sayHello"
}
def sayHelloInPipelineScriptWithArgs(String myArg, String branch = "master") {
echo "Hello from sayHelloInPipelineScriptWithArgs"
}
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
echo 'Running Stage 1'
// sayHello runs OK sayHello()
// sayHelloInPipelineScriptWithArgs is above, but I have
forgotten to pass a value for the argument
sayHelloInPipelineScriptWithArgs()
}
}
}
}
Console contains:
Pipeline] {
[Pipeline] stage
[Pipeline] { (Stage 1)
[Pipeline] echo
Running Stage 1
[Pipeline] echo
Hello from sayHello
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
an exception which occurred:
in field
org.codehaus.groovy.runtime.metaclass.MethodSelectionException.methods
in object
org.codehaus.groovy.runtime.metaclass.MethodSelectionException@ba293e4
in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals
... lots of other lines here ...
in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@34de9f29
in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@34de9f29
Caused: java.io.NotSerializableException: org.codehaus.groovy.util.FastArray
at
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
at
org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
... lots of other lines here ...
Jenkins ver. 2.124
Mac OS Sierra 10.12.6
Local install on a Macbook Pro
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/70252d77-2025-402e-bcad-0332ed8e4799%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.