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

Compilation error in shared library/global variable produces java.io.NotSerializableException org.codehaus.groovy.control.ErrorCollector

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      Pipeline: Groovy 2.57 and Pipeline: Shared Groovy Libraries 2.12

      Description

      I am trying to run the latest new feature to get output from sh command. Here is my code:

            _  emails = sh (
                  script: "git --no-pager show -s --format='%ae'   ${commit_hash}"
                  returnStdout: true
              )
              echo "emails: ${emails}"_
      

      I am getting back an error:

      java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
      	at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
      	at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
      	at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
      	at java.util.TreeMap.writeObject(TreeMap.java:2434)
      	at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
      	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.writeObject(RiverWriter.java:132)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:371)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:355)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:309)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	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:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: an exception which occurred:
      	in field collector
      	in field v
      	in field returnAddress
      	in field e
      	in field program
      	in field threads
      	in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@67742400
      Finished: FAILURE
      

      When I do not use returnStdout, the code works find executing the command (of course not returning anything)
      Any help there?
      Thanks

        Attachments

          Issue Links

            Activity

            sshkolni Sasha Shkolnik created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Summary returnStdout returns java.io.NotSerializableException org.codehaus.groovy.control.ErrorCollector Incorrect syntax produces java.io.NotSerializableException org.codehaus.groovy.control.ErrorCollector
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s workflow-durable-task-step-plugin [ 21715 ]
            Description I am trying to run the latest new feature to get output from sh command. Here is my code:
                  _ emails = sh (
                        script: "git --no-pager show -s --format='%ae' ${commit_hash}"
                        returnStdout: true
                    )
                    echo "emails: ${emails}"_
            I am getting back an error:
            {color:red}java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
            at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
            at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
            at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
            at java.util.TreeMap.writeObject(TreeMap.java:2434)
            at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            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.writeObject(RiverWriter.java:132)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:371)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:355)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:309)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            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:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: an exception which occurred:
            in field collector
            in field v
            in field returnAddress
            in field e
            in field program
            in field threads
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@67742400
            Finished: FAILURE{color}

            When I do not use returnStdout, the code works find executing the command (of course not returning anything)
            Any help there?
            Thanks
            I am trying to run the latest new feature to get output from sh command. Here is my code:

            {code}
                  _ emails = sh (
                        script: "git --no-pager show -s --format='%ae' ${commit_hash}"
                        returnStdout: true
                    )
                    echo "emails: ${emails}"_
            {code}

            I am getting back an error:

            {code:none}
            java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
            at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
            at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
            at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
            at java.util.TreeMap.writeObject(TreeMap.java:2434)
            at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            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.writeObject(RiverWriter.java:132)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:371)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:355)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:309)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            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:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: an exception which occurred:
            in field collector
            in field v
            in field returnAddress
            in field e
            in field program
            in field threads
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@67742400
            Finished: FAILURE
            {code}

            When I do not use returnStdout, the code works find executing the command (of course not returning anything)
            Any help there?
            Thanks
            jglick Jesse Glick made changes -
            Labels diagnostics
            abayer Andrew Bayer made changes -
            Summary Incorrect syntax produces java.io.NotSerializableException org.codehaus.groovy.control.ErrorCollector Compilation error in shared library/global variable produces java.io.NotSerializableException org.codehaus.groovy.control.ErrorCollector
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-26137 [ JENKINS-26137 ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-46698 [ JENKINS-46698 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-cps-global-lib-plugin [ 21714 ]
            Component/s workflow-cps-plugin [ 21713 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Link This issue is duplicated by JENKINS-45183 [ JENKINS-45183 ]
            abayer Andrew Bayer made changes -
            Comment [ Nope, that's just me being dumb. I forgot my {{sleep}} again. *facepalm* ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-218 (Web Link)" [ 19048 ]
            vivek Vivek Pandey made changes -
            Sprint Pipeline - Candidates [ 381 ]
            vivek Vivek Pandey made changes -
            Sprint Pipeline - Candidates [ 381 ]
            vivek Vivek Pandey made changes -
            Rank Ranked higher
            ulidtko Max M made changes -
            Link This issue is related to JENKINS-50740 [ JENKINS-50740 ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/workflow-cps-global-lib-plugin#53 (Web Link)" [ 21821 ]
            dnusbaum Devin Nusbaum made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            dnusbaum Devin Nusbaum made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            dnusbaum Devin Nusbaum made changes -
            Assignee Andrew Bayer [ abayer ] Rudolf-Walter Kiss-Szakacs [ rudolfwg ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/workflow-cps-plugin#250 (Web Link)" [ 21855 ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/workflow-cps-global-lib-plugin#54 (Web Link)" [ 21856 ]
            dnusbaum Devin Nusbaum made changes -
            Remote Link This issue links to "jenkinsci/workflow-cps-global-lib-plugin#53 (Web Link)" [ 21821 ]
            dnusbaum Devin Nusbaum made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Released As Pipeline: Groovy 2.57 and Pipeline: Shared Groovy Libraries 2.12
            fnaum Federico Naum made changes -
            Description I am trying to run the latest new feature to get output from sh command. Here is my code:

            {code}
                  _ emails = sh (
                        script: "git --no-pager show -s --format='%ae' ${commit_hash}"
                        returnStdout: true
                    )
                    echo "emails: ${emails}"_
            {code}

            I am getting back an error:

            {code:none}
            java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
            at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
            at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
            at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
            at java.util.TreeMap.writeObject(TreeMap.java:2434)
            at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            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.writeObject(RiverWriter.java:132)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:371)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:355)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:309)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            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:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: an exception which occurred:
            in field collector
            in field v
            in field returnAddress
            in field e
            in field program
            in field threads
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@67742400
            Finished: FAILURE
            {code}

            When I do not use returnStdout, the code works find executing the command (of course not returning anything)
            Any help there?
            Thanks
            I am trying to run the latest new feature to get output from sh command. Here is my code:
            {code:java}
                  _ emails = sh (
                        script: "git --no-pager show -s --format='%ae' ${commit_hash}"
                        returnStdout: true
                    )
                    echo "emails: ${emails}"_
            {code}
            I am getting back an error:
            {code:none}
            java.io.NotSerializableException: org.codehaus.groovy.control.ErrorCollector
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
            at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
            at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
            at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
            at java.util.TreeMap.writeObject(TreeMap.java:2434)
            at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
            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.writeObject(RiverWriter.java:132)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:371)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:355)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:309)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            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:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: an exception which occurred:
            in field collector
            in field v
            in field returnAddress
            in field e
            in field program
            in field threads
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@67742400
            Finished: FAILURE
            {code}
            When I do not use returnStdout, the code works find executing the command (of course not returning anything)
            Any help there?
            Thanks

              People

              • Assignee:
                rudolfwg Rudolf-Walter Kiss-Szakacs
                Reporter:
                sshkolni Sasha Shkolnik
              • Votes:
                7 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: