Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26137

Mysterious serialization errors

    XMLWordPrintable

Details

    Description

      A flow which just had

      node('...') {sh 'echo hi'}
      

      waited for a node matching the label. I restarted Jenkins after changing something so that the label would be available. The shell step ran, but then the flow failed with

      ...
      Running: Allocate node : End
      Running: End of Workflow
      java.io.NotSerializableException: org.jenkinsci.plugins.workflow.job.WorkflowJob
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:890)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:10S18)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:584)
      	at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
      	at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
      	at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.close(RiverWriter.java:145)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:341)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:323)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:297)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:183)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:181)
      	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)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmThread.run(CpsVmThread.java:21)
      Caused by: an exception which occurred:
      	in field task
      	in object java.util.ArrayList@401ac88
      Finished: FAILURE
      

      CpsStepContext.getThread then began complaining that

          no thread 2 among []
      

      as the DurableTaskStep$Execution.run kept on running.

      It is not apparent from this stack trace why something is trying to serialize the job.

      Observed also in PR 21; https://github.com/jenkinsci/workflow-plugin/commit/a594618516a22e9e8bcd016808ca487efee80fff fixed it. Turned out in that case that the culprit was ExecutorPickle. But why could the error message not say that? It only said field task, which was not enough information.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-25925 [ JENKINS-25925 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-26051 [ JENKINS-26051 ]
            jglick Jesse Glick made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            tg9541 Thomas Goeppel made changes -
            Description A flow which just had

            {code}
            node('...') {sh 'echo hi'}
            {code}

            waited for a node matching the label. I restarted Jenkins after changing something so that the label would be available. The shell step ran, but then the flow failed with

            {code:none}
            ...
            Running: Allocate node : End
            Running: End of Workflow
            java.io.NotSerializableException: org.jenkinsci.plugins.workflow.job.WorkflowJob
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:890)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:584)
            at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
            at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
            at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.close(RiverWriter.java:145)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:341)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:323)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:297)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:183)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:181)
            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)
            at org.jenkinsci.plugins.workflow.cps.CpsVmThread.run(CpsVmThread.java:21)
            Caused by: an exception which occurred:
            in field task
            in object java.util.ArrayList@401ac88
            Finished: FAILURE
            {code}

            {{CpsStepContext.getThread}} then began complaining that

            {code:none}
                no thread 2 among []
            {code}

            as the {{DurableTaskStep$Execution.run}} kept on running.

            It is not apparent from this stack trace why something is trying to serialize the job.

            Observed also in PR 21; https://github.com/jenkinsci/workflow-plugin/commit/a594618516a22e9e8bcd016808ca487efee80fff fixed it. Turned out in that case that the culprit was {{ExecutorPickle}}. But why could the error message not say that? It only said {{field task}}, which was not enough information.
            A flow which just had

            {code}
            node('...') {sh 'echo hi'}
            {code}

            waited for a node matching the label. I restarted Jenkins after changing something so that the label would be available. The shell step ran, but then the flow failed with

            {code:none}
            ...
            Running: Allocate node : End
            Running: End of Workflow
            java.io.NotSerializableException: org.jenkinsci.plugins.workflow.job.WorkflowJob
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:890)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:10S18)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:584)
            at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
            at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
            at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.close(RiverWriter.java:145)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:341)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:323)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:297)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:183)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:181)
            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)
            at org.jenkinsci.plugins.workflow.cps.CpsVmThread.run(CpsVmThread.java:21)
            Caused by: an exception which occurred:
            in field task
            in object java.util.ArrayList@401ac88
            Finished: FAILURE
            {code}

            {{CpsStepContext.getThread}} then began complaining that

            {code:none}
                no thread 2 among []
            {code}

            as the {{DurableTaskStep$Execution.run}} kept on running.

            It is not apparent from this stack trace why something is trying to serialize the job.

            Observed also in PR 21; https://github.com/jenkinsci/workflow-plugin/commit/a594618516a22e9e8bcd016808ca487efee80fff fixed it. Turned out in that case that the culprit was {{ExecutorPickle}}. But why could the error message not say that? It only said {{field task}}, which was not enough information.
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35396 [ 171189 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160127 ] JNJira + In-Review [ 180261 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Component/s workflow-support-plugin [ 21719 ]
            Component/s pipeline [ 21692 ]
            pyrocks Mor L made changes -
            Comment [ Or better yet - pipeline should start supporting all the data structures that are supported in groovy :)
            This includes (from the list of non-serialized objects I encountered so far): maps, xmlSlurper and sun.net.www.protocol.https.HttpsURLConnectionImpl ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-41770 [ JENKINS-41770 ]
            kohsuke Kohsuke Kawaguchi made changes -
            Labels robustness kohsuke-plane-project robustness
            jglick Jesse Glick made changes -
            Labels kohsuke-plane-project robustness diagnostics kohsuke-plane-project robustness
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-basic-steps PR 39 (Web Link)" [ 15812 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-40109 [ JENKINS-40109 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "jboss-marshalling PR 37 (Web Link)" [ 17156 ]
            jglick Jesse Glick made changes -
            Assignee Kohsuke Kawaguchi [ kohsuke ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 37 (Web Link)" [ 17158 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            svanoort Sam Van Oort made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-40 (Web Link)" [ 19133 ]
            jequals5 Marky Jackson made changes -
            Epic Link JENKINS-35396 [ 171189 ]

            People

              jglick Jesse Glick
              jglick Jesse Glick
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: