[JIRA] (JENKINS-38445) Pipeline withMaven Failed to serialize on agent

35 views
Skip to first unread message

post@michaelwittig.info (JIRA)

unread,
Sep 22, 2016, 8:31:03 AM9/22/16
to jenkinsc...@googlegroups.com
Michael Wittig created an issue
 
Jenkins / Bug JENKINS-38445
Pipeline withMaven Failed to serialize on agent
Issue Type: Bug Bug
Assignee: Alvaro Lobato
Components: pipeline-maven-plugin
Created: 2016/Sep/22 12:30 PM
Environment: Operating System: Amazon Linux 2016.03.3.x86_64
JRE/JDK: OpenJDK 7u111 / Oracle Java SE Development Kit 8u102
Jenkins and plugin versions: Jenkins 2.7.4 (more infos here: http://pastebin.com/DaeUW3au)
Whether you're running Jenkins directly or in a container: directly
Whether Jenkins is accessed through a reverse proxy: no
How you installed Jenkins: rpm (http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.7.4-1.1.noarch.rpm)
How you're launching any involved slave nodes: screen -m -D -S agent java -jar slave.jar -jnlpUrl ... -jnlpCredentials user:pwd
Your web browser: Chrome for Mac, 53.0.2785.116 (64-bit)
Labels: withMaven
Priority: Minor Minor
Reporter: Michael Wittig

Hi,

I have a pipeline that runs fine when scheduled on an agent:

node {
  try {
    stage('Checkout') {
      checkout scm
      checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'templates']], submoduleCfg: [], userRemoteConfigs: [[url: 'github.com:xxx.git', credentialsId: 'xxx']]], poll: true
    }
    currentBuild.result = 'SUCCESS'
  } catch (e) {
    currentBuild.result = 'FAILURE'
    throw e
  } finally {
    step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'xxx', sendToIndividuals: false])
  }
}

but when I use withMaven, I get an Exception:

node {
  try {
    stage('Checkout') {
      checkout scm
      checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'templates']], submoduleCfg: [], userRemoteConfigs: [[url: 'github.com:xxx.git', credentialsId: 'xxx']]], poll: true
    }
    stage('Test') {
      withMaven(jdk: 'default', maven: 'default', ) {
        sh "mvn clean test"
      }
      step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'])
    }
    currentBuild.result = 'SUCCESS'
  } catch (e) {
    currentBuild.result = 'FAILURE'
    throw e
  } finally {
    step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'xxx', sendToIndividuals: false])
  }
}

Exception

java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag#actions for class org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$Tag
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
	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:178)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:109)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:886)
	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:315)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.persist(FlowNode.java:302)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:278)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:269)
	at java.util.AbstractList.add(AbstractList.java:108)
	at hudson.model.Actionable.addAction(Actionable.java:129)
	at org.jenkinsci.plugins.workflow.cps.FlowHead.markIfFail(FlowHead.java:142)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:211)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:120)
	at groovy.lang.GroovyObject$invokeMethod.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 org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
	at WorkflowScript.run(WorkflowScript:8)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
	at sun.reflect.GeneratedMethodAccessor383.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	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:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.actions.ErrorAction#error for class org.jenkinsci.plugins.workflow.actions.ErrorAction
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
	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.ArrayConverter.marshal(ArrayConverter.java:45)
	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:265)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
	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:178)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:109)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:886)
	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:315)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.persist(FlowNode.java:302)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:278)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:269)
	at java.util.AbstractList.add(AbstractList.java:108)
	at hudson.model.Actionable.addAction(Actionable.java:129)
	at org.jenkinsci.plugins.workflow.cps.FlowHead.markIfFail(FlowHead.java:142)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:211)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:120)
	at groovy.lang.GroovyObject$invokeMethod.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 org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
	... 29 more
Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.google.inject.CreationException for security reasons
	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:442)
	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:265)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
	... 80 more
Finished: FAILURE

The pipeline runs successfully when scheduled on the master.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

post@michaelwittig.info (JIRA)

unread,
Sep 22, 2016, 8:47:01 AM9/22/16
to jenkinsc...@googlegroups.com
Michael Wittig updated an issue
Change By: Michael Wittig
Hi,

I have a pipeline that runs fine when scheduled on an agent:

{code:java}

node {
  try {
    stage('Checkout') {
      checkout scm
      checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'templates']], submoduleCfg: [], userRemoteConfigs: [[url: 'github.com:xxx.git', credentialsId: 'xxx']]], poll: true
    }
    currentBuild.result = 'SUCCESS'
  } catch (e) {
    currentBuild.result = 'FAILURE'
    throw e
  } finally {
    step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'xxx', sendToIndividuals: false])
  }
}
{code}


but when I use withMaven, I get an Exception:

{code:java}

node {
  try {
    stage('Checkout') {
      checkout scm
      checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'templates']], submoduleCfg: [], userRemoteConfigs: [[url: 'github.com:xxx.git', credentialsId: 'xxx']]], poll: true
    }
    stage('Test') {
      withMaven(jdk: 'default', maven: 'default'
, ) {

        sh "mvn clean test"
      }
      step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'])
    }
    currentBuild.result = 'SUCCESS'
  } catch (e) {
    currentBuild.result = 'FAILURE'
    throw e
  } finally {
    step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'xxx', sendToIndividuals: false])
  }
}
{code}

Exception
{noformat}
{noformat}



The pipeline runs successfully when scheduled on the master.

max.allan+jenkins@surevine.com (JIRA)

unread,
Sep 26, 2016, 9:52:01 AM9/26/16
to jenkinsc...@googlegroups.com
max allan commented on Bug JENKINS-38445
 
Re: Pipeline withMaven Failed to serialize on agent

I was having a similar error message and problem with withMaven not running on either slave or master.
Updated all plugins and core Jenkins from 2.21 to 2.23 and it seems to be working.
The cause is unknown, I'm pretty sure it was working with the old versions of everything...

alobato@cloudbees.com (JIRA)

unread,
Oct 5, 2016, 12:00:03 PM10/5/16
to jenkinsc...@googlegroups.com

post@michaelwittig.info (JIRA)

unread,
Oct 5, 2016, 2:30:01 PM10/5/16
to jenkinsc...@googlegroups.com

The only thing I know is that without the withMaven it works. I found JENKINS-38122 before opening this issue but the solution to the problem is missing in the ticket.

I now use a workaround with a docker container to provide maven and it works for me:

Jenkinsfile

  def environment  = docker.build 'xyz:snapshot'
    environment.inside {
      stage('Test') {
        sh "mvn clean test"
        step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'])
      }
    }
 
                                                            

Dockerfile

FROM centos:7.2.1511

RUN yum -y install epel-release
RUN yum -y install python-pip java-1.8.0-openjdk-devel wget

RUN wget -q -P / http://mirror.dkd.de/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz && mkdir /maven/ && tar xzvf /apache-maven-3.3.9-bin.tar.gz -C /maven/ --strip-components=1

ENV MAVEN_HOME=/maven
ENV PATH=/maven/bin/:$PATH
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk

RUN groupadd -g 497 jenkins
RUN adduser -u 498 -g 497 -s /bin/false -d /var/lib/jenkins -c 'Jenkins Continuous Integration Server' jenkins
USER jenkins

cleclerc@cloudbees.com (JIRA)

unread,
Oct 17, 2016, 5:33:01 AM10/17/16
to jenkinsc...@googlegroups.com

XStream refuses to serialize com.google.inject.CreationException. I have seen it debugging a problem on the Configuration File Provider Plugin.

The root cause of the problem was hidden by this XStream serialization exception. Maybe we could improve Jenkins / Xstream doing one of the following:

cleclerc@cloudbees.com (JIRA)

unread,
Oct 17, 2016, 6:36:01 AM10/17/16
to jenkinsc...@googlegroups.com
  • The error message if the JDK name is invalid is the expected message: "ERROR: Could not find the JDK installation: default-does-not-exist. Make sure it is configured on the Global Tool Configuration page"
  • The error message if both JDK names and Maven name are invalid is a good message: "ERROR: Could not find the JDK installation: default-does-not-exist. Make sure it is configured on the Global Tool Configuration page"
  • The error message if the Maven name is invalid is the good message: "ERROR: Could not find 'default-does-not-exist' maven installation."

cleclerc@cloudbees.com (JIRA)

unread,
Oct 17, 2016, 7:05:01 AM10/17/16
to jenkinsc...@googlegroups.com

Michael I get a 404 "This page has been removed!" trying to get the details of your environment on pastebin. Could you share with us details?

saponenko.denis@gmail.com (JIRA)

unread,
Oct 20, 2016, 10:56:01 AM10/20/16
to jenkinsc...@googlegroups.com

I got an error:

Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.google.inject.CreationException for
 security reasons
	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:442)
	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:265)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
	... 76 more

when make symlink workspace to another folder

cleclerc@cloudbees.com (JIRA)

unread,
Oct 20, 2016, 7:26:01 PM10/20/16
to jenkinsc...@googlegroups.com

Hello Denis,

We seem to have a problem with the c.g.i.CreationException that gets hidden by the XStream2$BlacklistedTypesConverter and this problem hides the root cause of your problem.

We are working at fixing the problem with the BlacklistedTypesConverter that hides the the c.g.i.CreationException.

Can you detail more what is the symlink that cause your failure? Can you provide an "ls -al" of the parent folder ...

saponenko.denis@gmail.com (JIRA)

unread,
Oct 21, 2016, 5:13:02 AM10/21/16
to jenkinsc...@googlegroups.com

saponenko.denis@gmail.com (JIRA)

unread,
Oct 21, 2016, 5:17:01 AM10/21/16
to jenkinsc...@googlegroups.com

saponenko.denis@gmail.com (JIRA)

unread,
Oct 21, 2016, 5:17:02 AM10/21/16
to jenkinsc...@googlegroups.com

saponenko.denis@gmail.com (JIRA)

unread,
Oct 21, 2016, 5:22:02 AM10/21/16
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Nov 16, 2016, 11:21:01 AM11/16/16
to jenkinsc...@googlegroups.com

Jesse Glick do you think that Pipeline / XStream2$BlacklistedTypesConverter could provide more detailed stack traces in such case?

More detailed than

Caused by: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.actions.ErrorAction#error for class org.jenkinsci.plugins.workflow.actions.ErrorAction
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
	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.ArrayConverter.marshal(ArrayConverter.java:45)
	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:265)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
	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:178)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.saveActions(SimpleXStreamFlowNodeStorage.java:109)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.saveActions(CpsFlowExecution.java:886)
	at org.jenkinsci.plugins.workflow.graph.FlowNode.save(FlowNode.java:315)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.persist(FlowNode.java:302)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:278)
	at org.jenkinsci.plugins.workflow.graph.FlowNode$1.add(FlowNode.java:269)
	at java.util.AbstractList.add(AbstractList.java:108)
	at hudson.model.Actionable.addAction(Actionable.java:129)
	at org.jenkinsci.plugins.workflow.cps.FlowHead.markIfFail(FlowHead.java:142)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:211)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:120)
	at groovy.lang.GroovyObject$invokeMethod.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 org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
	... 29 more
Caused by: java.lang.UnsupportedOperationException: Refusing to marshal com.google.inject.CreationException for security reasons
	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:442)
	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:265)
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
	... 80 more

jglick@cloudbees.com (JIRA)

unread,
Nov 16, 2016, 11:41:01 AM11/16/16
to jenkinsc...@googlegroups.com

A newer release of workflow-api already does better. Anyway this is tangential to the root cause here, still TBD.

jglick@cloudbees.com (JIRA)

unread,
Nov 16, 2016, 11:42:03 AM11/16/16
to jenkinsc...@googlegroups.com

Probably a duplicate of the other issue in this component.

cleclerc@cloudbees.com (JIRA)

unread,
Nov 16, 2016, 11:43:05 AM11/16/16
to jenkinsc...@googlegroups.com

Thanks Jesse Glick, you are right, we still need to understand what is the root cause, why the instantiation of the component through Juice failed.

cleclerc@cloudbees.com (JIRA)

unread,
Nov 16, 2016, 11:44:01 AM11/16/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Nov 23, 2016, 12:13:04 PM11/23/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Duplicate
 
Change By: Jesse Glick
Status: Open Resolved
Resolution: Duplicate

gabrielkonat@gmail.com (JIRA)

unread,
Nov 24, 2016, 10:23:02 AM11/24/16
to jenkinsc...@googlegroups.com
Gabriel Konat commented on Bug JENKINS-38445
 
Re: Pipeline withMaven Failed to serialize on agent

We're also running into this issue, but it is not always reproducible. Sometimes, after restarting Jenkins, the exception does not occur any more.
For example, build http://buildfarm.metaborg.org/job/metaborg/job/spoofax-releng/job/master/88/console failed because of the issue. But after a restart of Jenkins (and no other changes occurred), build http://buildfarm.metaborg.org/job/metaborg/job/spoofax-releng/job/master/89/console from the same job suddenly works.

Reply all
Reply to author
Forward
0 new messages