jenkinsci / templating-engine-plugin

create tool-agnostic, templated pipelines to be shared by multiple teams
https://jenkinsci.github.io/templating-engine-plugin/latest/
Apache License 2.0
170 stars 59 forks source link

External library declarative pipeline marshal errors #188

Closed chrishiner closed 3 years ago

chrishiner commented 3 years ago

Environment Information

Description

If I use an external library that contains a pipeline element from either the Jenkins file, or the provide default pipeline template from console box, I get an ugly exception about refusing to marshal.

Log:

[JTE] Obtained Template Configuration File
[JTE] -- scm: git https://XXXX
[JTE] -- file path: pipeline_config.groovy
[JTE] Pipeline Configuration Modifications
[JTE] Configurations Added:
[JTE] - application_environments set to [:]
[JTE] - libraries set to [:]
[JTE] Configurations Deleted: None
[JTE] Configurations Changed: None
[JTE] Configurations Duplicated: None
[JTE] Configurations Ignored: None
[JTE] Subsequent May Merge: None
[JTE] Subsequent May Override: None
[JTE] Obtained Repository Jenkinsfile
[JTE] -- scm: git https://XXXX
[JTE] -- file path: Jenkinsfile
Running in Durability level: MAX_SURVIVABILITY
Loading library jte-test-library
Attempting to resolve XXXX from remote references...
 > git --version # timeout=10
using GIT_SSH to set credentials XXXX
 > git ls-remote -h -- XXXX # timeout=10
Found match: XXXX revision XXXX
using credential XXXX
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url XXXX # timeout=10
Fetching without tags
Fetching upstream changes from XXXX
 > git --version # timeout=10
using GIT_SSH to set credentials XXXX
 > git fetch --no-tags --progress -- XXXX +refs/heads/*:refs/remotes/origin/* # timeout=10
Checking out Revision XXXX
 > git config core.sparsecheckout # timeout=10
 > git checkout -f XXXX # timeout=10
Commit message: XXXX
 > git rev-list --no-walk XXXX # timeout=10
Excluding src/test/ from checkout of git XXXX so that shared library test code cannot be accessed by Pipelines.
To remove this log message, move the test code outside of src/. To restore the previous behavior that allowed access to files in src/test/, pass -Dorg.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.INCLUDE_SRC_TEST_IN_LIBRARIES=true to the java command used to start Jenkins.
[Pipeline] Start of Pipeline
[Pipeline] End of Pipeline
java.lang.UnsupportedOperationException: Refusing to marshal groovy.lang.Binding for security reasons; see https://jenkins.io/redirect/class-filter/
    at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:541)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:250)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:226)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:189)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:135)
    at com.thoughtworks.xstream.converters.reflection.SerializableConverter.marshalUnserializableParent(SerializableConverter.java:292)
    at com.thoughtworks.xstream.converters.reflection.SerializableConverter.doMarshal(SerializableConverter.java:246)
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:83)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:262)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:249)
Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class org.boozallen.plugins.jte.init.primitives.TemplateBinding
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:253)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:221)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:207)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:148)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:262)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:249)
Caused: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.PipelineDecorator#binding for class org.boozallen.plugins.jte.init.PipelineDecorator
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:253)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:221)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:207)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:148)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:262)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:249)
Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:253)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:221)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:207)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:148)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
    at hudson.XmlFile.write(XmlFile.java:195)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at sun.reflect.GeneratedMethodAccessor1135.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.updateRunAndJobActions(Utils.groovy:302)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$updateRunAndJobActions$4.call(Unknown Source)
    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)
Caused: java.io.IOException
    at hudson.XmlFile.write(XmlFile.java:202)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at sun.reflect.GeneratedMethodAccessor1135.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.updateRunAndJobActions(Utils.groovy:302)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$updateRunAndJobActions$4.call(Unknown Source)
    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 org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:66)
    at traditionalPipeline.call(traditionalPipeline.groovy:2)
    at WorkflowScript.run(WorkflowScript:2)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
    at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:76)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
    at sun.reflect.GeneratedMethodAccessor642.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    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:129)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    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

Jenkinsfile:

@Library('jte-test-library') _
testLibrary()

testLibrary.groovy:

def call() {
    pipeline {
        agent none
        stages {
            stage('whee') {
                steps {
                    script {
                        echo "why"
                    }
                }
            }
        }
    }
}

pipeline_config.groovy:

application_environments {
}

libraries {
}

To isolate it as much as possible, I currently have nothing set globally for JTE, just at the multibranch pipeline job level.

Adding -Dhudson.remoting.ClassFilter=groovy.lang.Binding gets past this initial error as others have suggested on gitter, but that's kind of ugly. I'm still trying to figure out some other things that broke in our code between 1.5 and 2.0.4.

chrishiner commented 3 years ago

If I put the same pipeline block directly into the Jenkins file, then it works. It only seems to break if it's loaded from a library.

If I load the library from the Jenkinsfile in the source repo and change the Build Configuration from JTE to Jenkins, then it also works as expected when JTE isn't involved.

Also, I had to set the library to be loaded implicitly, otherwise it wouldn't even find the library.

steven-terrana commented 3 years ago

Thanks for letting us know @chrishiner. We'll take a look as soon as we can.

chrishiner commented 3 years ago

I have a workaround (and overall cleaner solution) that just completely avoids using it as a library. If I take the library, remove the def call() { bit, and use it as a pipeline_template in my Global Governance Tier, then it works as expected. Then I can set allow_scm_jenkinsfile = false, and set the pipeline_template in the pipeline_config.groovy (or use my global default.), and I don't have to touch all the existing Jenkinsfile's.

The hudson.remoting.ClassFilter bit is no longer needed when using this solution.

It still might be worth fixing this, as maybe it means some other conditions aren't going to work as expected, but it's no longer a blocker for me.

deskoh commented 3 years ago

Encountered similar errors with the following config:

Jenkinsfile:

build()

pipeline_config.groovy:

libraries {
    npm
}

npm\steps\build.groovy:

void call() {
    docker.image('node:12').inside('') {
    }
}
cokieffebah commented 3 years ago

@deskoh could you share the error log. thanks

deskoh commented 3 years ago

Sure.

Started by user XXXX
[JTE] Obtained Pipeline Configuration File 
[JTE] -- scm: git git@gitlab.internal:my-group/jte-config.git
[JTE] -- file path: pipeline_config.groovy
[JTE] Pipeline Configuration Modifications 
[JTE] Configurations Added:
[JTE] - jte.allow_scm_jenkinsfile set to true
[JTE] - libraries.npm set to [:]
[JTE] Configurations Deleted: None
[JTE] Configurations Changed: None
[JTE] Configurations Duplicated: None
[JTE] Configurations Ignored: None
[JTE] Subsequent May Merge:
[JTE] - libraries
[JTE] Subsequent May Override: None
[JTE] Pipeline Configuration Modifications 
[JTE] Configurations Added: None
[JTE] Configurations Deleted: None
[JTE] Configurations Changed: None
[JTE] Configurations Duplicated:
[JTE] - libraries.npm
[JTE] Configurations Ignored: None
[JTE] Subsequent May Merge: None
[JTE] Subsequent May Override: None
[JTE] Loading Library npm (show)
[JTE] JTE Primitives overrode Plugin provided steps and/or variables: 
[JTE] - build
[JTE] created Library Steps: 
[JTE] build from the npm Library
[JTE] unit_test from the npm Library
[JTE] Obtained Pipeline Template from job configuration
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[JTE][Step - npm/build.call()]
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
hudson.remoting.ProxyException: java.lang.UnsupportedOperationException: Refusing to marshal libraries.npm.steps.WorkflowScript for security reasons; see https://jenkins.io/redirect/class-filter/
    at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:541)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:272)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:259)
Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.docker.workflow.Docker#script for class org.jenkinsci.plugins.docker.workflow.Docker
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:263)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:231)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:217)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:272)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:259)
Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class org.boozallen.plugins.jte.init.primitives.TemplateBinding
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:263)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:231)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:217)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:272)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:259)
Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.PipelineDecorator#binding for class org.boozallen.plugins.jte.init.PipelineDecorator
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:263)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:231)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:217)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:272)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:259)
Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:263)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:231)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:217)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
    at hudson.XmlFile.write(XmlFile.java:195)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl.forRun(EnvActionImpl.java:163)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl$Binder.getValue(EnvActionImpl.java:176)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl$Binder.getValue(EnvActionImpl.java:169)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:39)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
Caused: hudson.remoting.ProxyException: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at hudson.XmlFile.write(XmlFile.java:202)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl.forRun(EnvActionImpl.java:163)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl$Binder.getValue(EnvActionImpl.java:176)
    at org.jenkinsci.plugins.workflow.cps.EnvActionImpl$Binder.getValue(EnvActionImpl.java:169)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:39)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
    at org.jenkinsci.plugins.docker.workflow.Docker.node(Docker.groovy:64)
    at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(Docker.groovy:114)
    at libraries.npm.steps.WorkflowScript.call(WorkflowScript:9)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
    at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at org.boozallen.plugins.jte.init.primitives.injectors.StepWrapper.invoke(script1616563616488911504882.groovy:171)
    at org.boozallen.plugins.jte.init.primitives.injectors.StepWrapper.call(script1616563616488911504882.groovy:143)
    at WorkflowScript.run(WorkflowScript:1)
    at ___cps.transform___(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.constructorCall(DefaultInvoker.java:25)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:97)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
    at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
    at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
    at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
    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:129)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
    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
Opa- commented 3 years ago

Hello,

I had the same kind of error this morning on all of our jobs.

Environment Information

Started by user ***
Running as ***
[JTE] Obtained Pipeline Configuration File
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-configuration.git
[JTE] -- file path: pipeline_config.groovy
[JTE] Pipeline Configuration Modifications
[JTE] Configurations Added:
[JTE] - jte.allow_scm_jenkinsfile set to false
[JTE] - application_environments.dev.long_name set to Development Environments
[JTE] - application_environments.dev.branch set to master
[JTE] - application_environments.dev.argocd.credential_id set to some_credential
[JTE] - application_environments.dev.argocd.ip set to 127.0.0.1
[JTE] - template_methods set to [:]
[JTE] - stages.continuous_integration.unit_test set to [:]
[JTE] - stages.continuous_integration.static_code_analysis set to [:]
[JTE] - stages.continuous_integration.build_artifacts set to [:]
[JTE] - stages.application.unit_test set to [:]
[JTE] - stages.application.static_code_analysis set to [:]
[JTE] - stages.application.build_artifacts set to [:]
[JTE] - stages.dbmdl.unit_test set to [:]
[JTE] - stages.dbmdl.build_artifacts set to [:]
[JTE] - libraries.jenkins_pipeline_configuration set to [:]
[JTE] - libraries.sonarqube set to [:]
[JTE] - libraries.argocd set to [:]
[JTE] - libraries.gitlab set to [:]
[JTE] Configurations Deleted: None
[JTE] Configurations Changed: None
[JTE] Configurations Duplicated: None
[JTE] Configurations Ignored: None
[JTE] Subsequent May Merge:
[JTE] - jte
[JTE] - application_environments.dev.argocd
[JTE] - libraries
[JTE] Subsequent May Override:
[JTE] - application_environments.dev
Querying the current revision of branch hotfix/1.16.1...
Current revision of branch hotfix/1.16.1 is d2a7b8897415373d9cc754f126b7247cedc6f0b6
[JTE] Obtained Template Configuration File
[JTE] -- scm: git ssh://***.git
[JTE] -- file path: pipeline_config.groovy
[JTE] Pipeline Configuration Modifications
[JTE] Configurations Added:
[JTE] - libraries.maven_gitflow set to [:]
[JTE] Configurations Deleted: None
[JTE] Configurations Changed: None
[JTE] Configurations Duplicated: None
[JTE] Configurations Ignored: None
[JTE] Subsequent May Merge: None
[JTE] Subsequent May Override: None
[JTE] Loading Library jenkins_pipeline_configuration
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-library.git
[JTE] Loading Library sonarqube
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-library.git
[JTE] Loading Library argocd
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-library.git
[JTE] Loading Library gitlab
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-library.git
[JTE] Loading Library maven_gitflow
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-library.git
[JTE] created Application Environments:
[JTE] dev
[JTE] created Library Steps:
[JTE] init_checkout from the jenkins_pipeline_configuration Library
[JTE] init_job_properties from the jenkins_pipeline_configuration Library
[JTE] static_code_analysis from the sonarqube Library
[JTE] deploy_to from the argocd Library
[JTE] update_release_notes from the gitlab Library
[JTE] build_artifacts from the maven_gitflow Library
[JTE] library_config_default from the maven_gitflow Library
[JTE] set_jenkins_job_description from the maven_gitflow Library
[JTE] unit_test from the maven_gitflow Library
[JTE] created Stages:
[JTE] continuous_integration
[JTE] application
[JTE] dbmdl
Querying the current revision of branch hotfix/1.16.1...
Current revision of branch hotfix/1.16.1 is d2a7b8897415373d9cc754f126b7247cedc6f0b6
[JTE] Jenkinsfile exists but is not a file.
[JTE] -- scm: git ssh://***.git
[JTE] Obtained Template
[JTE] -- scm: git ssh://***/continuous-integration/jenkins-jte-configuration.git
[JTE] -- file path: Jenkinsfile
java.lang.UnsupportedOperationException: Refusing to marshal org.boozallen.plugins.jte.init.primitives.injectors.Stage for security reasons; see https://jenkins.io/redirect/class-filter/
    at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:540)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.primitives.PrimitiveNamespace#primitives for class org.boozallen.plugins.jte.init.primitives.injectors.CallableNamespace
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.primitives.TemplateBindingRegistry#namespaces for class org.boozallen.plugins.jte.init.primitives.TemplateBindingRegistry
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class org.boozallen.plugins.jte.init.primitives.TemplateBinding
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.PipelineDecorator#binding for class org.boozallen.plugins.jte.init.PipelineDecorator
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1255)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1244)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1217)
    at hudson.XmlFile.write(XmlFile.java:195)
Caused: java.io.IOException
    at hudson.XmlFile.write(XmlFile.java:202)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at sun.reflect.GeneratedMethodAccessor1263.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:158)
    at org.boozallen.plugins.jte.job.TemplateFlowDefinition$_initializeJTE_closure1.doCall(TemplateFlowDefinition.groovy:64)
    at sun.reflect.GeneratedMethodAccessor1261.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at groovy.lang.Closure.call(Closure.java:414)
    at groovy.lang.Closure.call(Closure.java:430)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:242)
    at org.codehaus.groovy.runtime.dgm$758.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.boozallen.plugins.jte.job.TemplateFlowDefinition.initializeJTE(TemplateFlowDefinition.groovy:62)
    at sun.reflect.GeneratedMethodAccessor1139.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
    at org.boozallen.plugins.jte.job.TemplateFlowDefinition.create(TemplateFlowDefinition.groovy:54)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

What's weird is that a simple restart of Jenkins fixes the problem somehow. The impacted builds are not reachable from the UI of Jenkins but exist on the filesystem with the log file, log-index (empty) file and the jte directory with all the libraries.

Jenkinsfile (loaded from external jte configuration git)

continuous_integration()
deploy_to dev

pipeline_config.groovy of the config git

/*
    Settings
 */

@merge jte {
    // restrict individual repository Jenkinsfiles
    allow_scm_jenkinsfile = false
}

/*
    Environments
 */
application_environments {
    @override dev {
        long_name = "Development Environments"
        branch = "master"
        @merge argocd {
            credential_id = 'some_credential'
            ip = '127.0.0.1'
        }
    }
}

/*
    Template Methods
    By default, JTE provides default step implementation but we want the pipeline to fail if
    the library is missing one of the step implementation. Setting this to an empty dictionary
    will disable the default step implementation provided by JTE.
    For more info see:
        - https://github.com/jenkinsci/templating-engine-plugin/issues/57
        - https://jenkinsci.github.io/templating-engine-plugin/pages/Pipeline_Templating/configuration_files.html?highlight=template_methods#template-methods
 */
template_methods {
}

/*
    Stages
 */
stages {
    continuous_integration {
        unit_test
        static_code_analysis
        build_artifacts
    }
}

/*
    Libraries
    specify which libraries to load:
        In the Governance Tier configuration file,
        these should be configurations common across
        all apps governed by this config.
*/
@merge libraries {
    jenkins_pipeline_configuration
    sonarqube
    argocd
    gitlab
}

pipeline_config.groovy of the project

libraries {
    maven_gitflow
}

Here's the first step that is executed

import org.boozallen.plugins.jte.init.primitives.hooks.Init

@Init
void call() {
    stage('Checkout') {
        node() {
            cleanWs()
            checkout scm

            sh 'env | sort'

            stash name: 'workspace', allowEmpty: true, useDefaultExcludes: false
        }
    }
}

This happened on Jenkins 2.284. Like I said a restart fixed the error 🤔. Once fixed, I upgraded Jenkins to 2.285 and did not notice any error.

cokieffebah commented 3 years ago

Thanks @Opa- and @deskoh

deskoh commented 3 years ago

Upgraded Jenkins to 2.277.1. Build can succeed now. Previous version was 2.263.3.

addihorn commented 3 years ago

HI @cokieffebah I am curretly facing the same issue. We are getting an error message (Serverlog)

This happens after a checkout scm - presumable at the notification step. We get this behavior even, when the checkout is inside of an actual library (not just in the Jenkins-File itself).

Environment

Jenkins version 2.286 Plugin version 2.0.4

Version of Openshift Client Plugin: 1.0.34 Version of Git Plugin: 4.7.0

Mar 30, 2021 4:21:13 PM WARNING org.jenkinsci.plugins.workflow.cps.CpsFlowExecution notifyListeners
null
java.lang.UnsupportedOperationException: Refusing to marshal com.openshift.jenkins.plugins.OpenShiftDSL$Capabilities for security reasons; see https://jenkins.io/redirect/class-filter/
    at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:540)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize com.openshift.jenkins.plugins.OpenShiftDSL#nodeCapabilities for class com.openshift.jenkins.plugins.OpenShiftDSL
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:79)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize groovy.lang.Binding#variables for class org.boozallen.plugins.jte.init.primitives.TemplateBinding
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize org.boozallen.plugins.jte.init.PipelineDecorator#binding for class org.boozallen.plugins.jte.init.PipelineDecorator
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:87)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeBareItem(AbstractCollectionConverter.java:94)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeCompleteItem(AbstractCollectionConverter.java:81)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:83)
    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:275)
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:262)
Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:266)
    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:233)
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:150)
    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:219)
    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:158)
    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1276)
    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1265)
    at com.thoughtworks.xstream.XStream.toXML(XStream.java:1238)
    at hudson.XmlFile.write(XmlFile.java:195)
Caused: java.io.IOException
    at hudson.XmlFile.write(XmlFile.java:202)
    at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1210)
    at hudson.BulkChange.commit(BulkChange.java:98)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1485)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:489)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    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)

Jenkinsfile:

Map databaseDeploymentHost = deploy(
    from: "docker.io/busybox",
    template: "budybox/deploymentConfig.yaml"
)

println "Outside of the steps: " + databaseDeploymentHost.podIPs[0]

agent(image: "https://registry.scm.exampleorga.org/jenkins/jnlp-npm-agent:latest", tags: "npm") {
    println "Inside the agent block: " + databaseDeploymentHost.podIPs[0]
    stage('Run integration tests') {
        println "Inside the stage block: " + databaseDeploymentHost.podIPs[0]

        checkout scm //<---- the pipeline fails here
        println "Shortly after checkout: " + databaseDeploymentHost.podIPs[0]
    }
}

Library deploy():

Map call(Map args = [:]) {     

    String deploymentTemplateFile = args.template ?: ''
    String containerImage = args.from ?: ''
    Map returnMap = [:]

    if (containerImage=='' || deploymentTemplateFile=='') {
        error   "[openshift.deploy] Push skipped due to missing value from:${containerImage}" +
                " / template:${deploymentTemplateFile}"
        return
    }    

    agent()
    {        
        stage("Deploy Application for Testing") {
            openshift.withCluster(){                
                openshift.withProject() {
                    println '[openshift.deploy] Creating Deployment Template'
                    def deploymentTemplate = 
                            openshiftLocal.process(readFile(file:deploymentTemplateFile),
                                "-p=REPOSITORY_URL=${containerImage}")

                    def appliedObjects = openshift.apply(deploymentTemplate)
                    appliedObjects.label([jenkinsBuildId:config.jenkinsBuildId], "--overwrite")

                    returnMap.podIPs = []
                    appliedObjects.narrow("dc").withEach {
                        //wait for successfull deployment of each deploymentConfig
                        it.rollout().status("--watch=true")

                        openshift.selector("po", [deploymentconfig:it.object().metadata.name]
                            ).withEach {
                                println '[openshift.deploy] Created Pod with IP: ' + 
                                            it.object().status.podIP
                                returnMap.podIPs.add(it.object().status.podIP.toString())
                            }
                    }

                    appliedObjects.narrow("svc").withEach {
                        println '[openshift.deploy] Serving new Sevice at Cluster IP: ' + 
                                    it.object().spec.clusterIP 
                        returnMap.url = it.object().spec.clusterIP.toString()
                    }            
                }
            }
        }
    }

    println "[openshift.deploy] Returning Deployment-Data: " + returnMap.toMapString()
    return returnMap
}

Library agent():

void call(Map args = [:], body) {
    String agentImage = args.image ?: config.jteBaseAgentImage
    podTemplate(
        containers : [
            containerTemplate(
                name: 'jnlp',
                image: agentImage,
                ttyEnabled: true,
                alwaysPullImage: true
            )
        ],
        serviceAccount : 'jenkins'
    ) {
        node(POD_LABEL) {
            script {
                body.call()
            } 
        }
    }
}