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

NotSerializableException seen sporadically when running 5 parallel branches

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
    • Sprint:
      Declarative - 1.2
    • Similar Issues:

      Description

      Summary:
      While building from a Jenkinsfile that includes several parallel stages, each of which override directives like agent, tools, and environment, builds occasionally fail with a java.io.NotSerializableException. I suspect this is a race condition, a weird timing glitch, or some other difficult to recreate corner case. (And I know, it's a pretty...odd?...Jenkinsfile).

      Reproducibility:
      Seen twice in ten builds.

      Prerequisites:
      This might not matter, but use a GitHub repo into which the attached Jenkinsfile can be checked in. I have not been able to recreate this as an inline Pipeline job yet (IOW, as a Pipeline hand-edited into the job itself).

      Attachments:

      • I've attached the Jenkinsfile I was using when I first saw this (I've seen it twice now).
      • I've also tarred up the build folder, from my Jenkins server, for a failed build. That's $JENKINS_HOME/jobs/dev1/jobs/declarative-parser-rewrite/branches/a-parallel-bug-in-the-making/builds/9

      Steps to recreate:
      1. Set up a Jenkins with one remote Linux agent, launched via SSH, with the label linux

      2. Check the attached Jenkinsfile into your otherwise empty GitHub repo, and build it.

      3. If you get lucky, you'll see the failure. I've noticed that Stage View always displays the failure as happening in the parallel-5 branch. Don't know if that's useful info or not:

      4. Read the logs to see the NotSerializableException:

      Started by user admin
      Connecting to https://github.beescloud.com/api/v3 using admin/****** (GitHub Enterprise Access Token)
      Obtained Jenkinsfile from e316e55cd44cee55eed9c045eeaee1e3bd0fb781
      [Pipeline] node
      Running on 14-agent in /home/ec2-user/jenkins/jenkins/workspace/-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Checkout SCM)
      [Pipeline] checkout
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url https://github.beescloud.com/dev1/declarative-parser-rewrite.git # timeout=10
      Fetching without tags
      Fetching upstream changes from https://github.beescloud.com/dev1/declarative-parser-rewrite.git
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials GitHub Enterprise Access Token
       > git fetch --no-tags --progress https://github.beescloud.com/dev1/declarative-parser-rewrite.git +refs/heads/a-parallel-bug-in-the-making:refs/remotes/origin/a-parallel-bug-in-the-making
      Checking out Revision e316e55cd44cee55eed9c045eeaee1e3bd0fb781 (a-parallel-bug-in-the-making)
      Commit message: "See if I can recreate the other weird thing."
       > git config core.sparsecheckout # timeout=10
       > git checkout -f e316e55cd44cee55eed9c045eeaee1e3bd0fb781
       > git rev-list d02684d0341238697ea785357f2c97b71f63d0b6 # timeout=10
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] timestamps
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Tool Install)
      [Pipeline] tool
      [Pipeline] envVarsForTool
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Parallel Wrapper)
      [Pipeline] parallel
      [Pipeline] [parallel-1] { (Branch: parallel-1)
      [Pipeline] [parallel-2 overrides environment variables] { (Branch: parallel-2 overrides environment variables)
      [Pipeline] [parallel-3 back to jdk8] { (Branch: parallel-3 back to jdk8)
      [Pipeline] [parallel-4 back to jdk7] { (Branch: parallel-4 back to jdk7)
      [Pipeline] [parallel-5 back to jdk8] { (Branch: parallel-5 back to jdk8)
      [Pipeline] [parallel-1] stage
      [Pipeline] [parallel-1] { (parallel-1)
      [Pipeline] [parallel-2 overrides environment variables] stage
      [Pipeline] [parallel-2 overrides environment variables] { (parallel-2 overrides environment variables)
      [Pipeline] [parallel-3 back to jdk8] stage
      [Pipeline] [parallel-3 back to jdk8] { (parallel-3 back to jdk8)
      [Pipeline] [parallel-4 back to jdk7] stage
      [Pipeline] [parallel-4 back to jdk7] { (parallel-4 back to jdk7)
      [Pipeline] [parallel-5 back to jdk8] stage
      [Pipeline] [parallel-5 back to jdk8] { (parallel-5 back to jdk8)
      [Pipeline] [parallel-2 overrides environment variables] node
      [parallel-2 overrides environment variables] Running on 14-agent in /home/ec2-user/jenkins/jenkins/workspace/-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ@2
      [Pipeline] [parallel-3 back to jdk8] withEnv
      [Pipeline] [parallel-3 back to jdk8] {
      [Pipeline] [parallel-4 back to jdk7] withEnv
      [Pipeline] [parallel-4 back to jdk7] {
      [Pipeline] [parallel-5 back to jdk8] withEnv
      [Pipeline] [parallel-5 back to jdk8] {
      [Pipeline] [parallel-2 overrides environment variables] {
      [Pipeline] [parallel-1] tool
      [Pipeline] [parallel-3 back to jdk8] tool
      [Pipeline] [parallel-4 back to jdk7] tool
      [Pipeline] [parallel-5 back to jdk8] tool
      [Pipeline] [parallel-2 overrides environment variables] checkout
      [parallel-2 overrides environment variables]  > git rev-parse --is-inside-work-tree # timeout=10
      [parallel-2 overrides environment variables] Fetching changes from the remote Git repository
      [parallel-2 overrides environment variables]  > git config remote.origin.url https://github.beescloud.com/dev1/declarative-parser-rewrite.git # timeout=10
      [parallel-2 overrides environment variables] Fetching without tags
      [parallel-2 overrides environment variables] Fetching upstream changes from https://github.beescloud.com/dev1/declarative-parser-rewrite.git
      [parallel-2 overrides environment variables]  > git --version # timeout=10
      [parallel-2 overrides environment variables] using GIT_ASKPASS to set credentials GitHub Enterprise Access Token
      [parallel-2 overrides environment variables]  > git fetch --no-tags --progress https://github.beescloud.com/dev1/declarative-parser-rewrite.git +refs/heads/a-parallel-bug-in-the-making:refs/remotes/origin/a-parallel-bug-in-the-making
      [Pipeline] [parallel-1] envVarsForTool
      [Pipeline] [parallel-3 back to jdk8] envVarsForTool
      [Pipeline] [parallel-4 back to jdk7] envVarsForTool
      [Pipeline] [parallel-5 back to jdk8] envVarsForTool
      [Pipeline] [parallel-1] withEnv
      [Pipeline] [parallel-1] {
      [Pipeline] [parallel-3 back to jdk8] withEnv
      [Pipeline] [parallel-3 back to jdk8] {
      [Pipeline] [parallel-4 back to jdk7] withEnv
      [Pipeline] [parallel-4 back to jdk7] {
      [Pipeline] [parallel-5 back to jdk8] withEnv
      [Pipeline] [parallel-5 back to jdk8] {
      [Pipeline] [parallel-1] echo
      [parallel-1] --> AGENT_NAME is linux 
      [Pipeline] [parallel-1] echo
      [parallel-1] --> What version of java?
      [Pipeline] [parallel-1] sh
      [parallel-1] [-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ] Running shell script
      [Pipeline] [parallel-3 back to jdk8] echo
      [parallel-3 back to jdk8] --> What version of java?
      [Pipeline] [parallel-3 back to jdk8] sh
      [parallel-3 back to jdk8] [-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ] Running shell script
      [Pipeline] [parallel-4 back to jdk7] echo
      [parallel-4 back to jdk7] --> What version of java?
      [Pipeline] [parallel-4 back to jdk7] sh
      [parallel-4 back to jdk7] [-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ] Running shell script
      [Pipeline] [parallel-5 back to jdk8] echo
      [parallel-5 back to jdk8] --> What version of java?
      [Pipeline] [parallel-5 back to jdk8] sh
      [parallel-2 overrides environment variables] Checking out Revision e316e55cd44cee55eed9c045eeaee1e3bd0fb781 (a-parallel-bug-in-the-making)
      [parallel-2 overrides environment variables] Commit message: "See if I can recreate the other weird thing."
      [parallel-2 overrides environment variables]  > git config core.sparsecheckout # timeout=10
      [parallel-2 overrides environment variables]  > git checkout -f e316e55cd44cee55eed9c045eeaee1e3bd0fb781
      [parallel-1] + java -version
      [parallel-1] java version "1.8.0_144"
      [parallel-1] Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      [parallel-1] Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
      [parallel-5 back to jdk8] [-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ] Running shell script
      [Pipeline] [parallel-1] }
      [Pipeline] [parallel-1] // withEnv
      [parallel-3 back to jdk8] + java -version
      [parallel-3 back to jdk8] java version "1.8.0_144"
      [parallel-3 back to jdk8] Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      [parallel-3 back to jdk8] Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
      [Pipeline] [parallel-1] }
      [Pipeline] [parallel-1] // stage
      [parallel-4 back to jdk7] + java -version
      [parallel-4 back to jdk7] java version "1.7.0_80"
      [parallel-4 back to jdk7] Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
      [parallel-4 back to jdk7] Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
      [Pipeline] [parallel-1] }
      [Pipeline] [parallel-3 back to jdk8] echo
      [parallel-3 back to jdk8] Let's check our environment variables
      [Pipeline] [parallel-3 back to jdk8] echo
      [parallel-3 back to jdk8] This has been inherited!
      [Pipeline] [parallel-3 back to jdk8] echo
      [parallel-3 back to jdk8] YES --> OVERRIDDEN BY PARALLEL-3
      [Pipeline] [parallel-3 back to jdk8] }
      [parallel-5 back to jdk8] + java -version
      [parallel-5 back to jdk8] java version "1.8.0_144"
      [parallel-5 back to jdk8] Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      [parallel-5 back to jdk8] Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
      [Pipeline] [parallel-3 back to jdk8] // withEnv
      [Pipeline] [parallel-3 back to jdk8] }
      [Pipeline] [parallel-4 back to jdk7] echo
      [parallel-4 back to jdk7] Let's check our environment variables
      [Pipeline] [parallel-4 back to jdk7] echo
      [parallel-4 back to jdk7] This has been inherited!
      [Pipeline] [parallel-4 back to jdk7] echo
      [parallel-4 back to jdk7] YES --> OVERRIDDEN BY PARALLEL-4
      [Pipeline] [parallel-4 back to jdk7] }
      [Pipeline] [parallel-5 back to jdk8] }
      [Pipeline] [parallel-3 back to jdk8] // withEnv
      [Pipeline] [parallel-4 back to jdk7] // withEnv
      [Pipeline] [parallel-3 back to jdk8] }
      [Pipeline] [parallel-4 back to jdk7] }
      [Pipeline] [parallel-5 back to jdk8] // withEnv
      [Pipeline] [parallel-5 back to jdk8] }
      [Pipeline] [parallel-2 overrides environment variables] withEnv
      [Pipeline] [parallel-2 overrides environment variables] {
      [Pipeline] [parallel-3 back to jdk8] // stage
      [Pipeline] [parallel-4 back to jdk7] // withEnv
      [Pipeline] [parallel-3 back to jdk8] }
      [Pipeline] [parallel-4 back to jdk7] }
      [Pipeline] [parallel-5 back to jdk8] // withEnv
      [Pipeline] [parallel-5 back to jdk8] }
      [Pipeline] [parallel-2 overrides environment variables] withEnv
      [Pipeline] [parallel-2 overrides environment variables] {
      [Pipeline] [parallel-4 back to jdk7] // stage
      [Pipeline] [parallel-4 back to jdk7] }
      [Pipeline] [parallel-5 back to jdk8] // stage
      [Pipeline] [parallel-5 back to jdk8] }
      [parallel-5 back to jdk8] Failed in branch parallel-5 back to jdk8
      [Pipeline] [parallel-2 overrides environment variables] tool
      [Pipeline] [parallel-2 overrides environment variables] envVarsForTool
      [Pipeline] [parallel-2 overrides environment variables] withEnv
      [Pipeline] [parallel-2 overrides environment variables] {
      [Pipeline] [parallel-2 overrides environment variables] echo
      [parallel-2 overrides environment variables] --> What version of java?
      [Pipeline] [parallel-2 overrides environment variables] sh
      [parallel-2 overrides environment variables] [-parallel-bug-in-the-making-JHYWOAGTRH755AJK65TA2IZCC5I7G63CN4VIB23FCFKPIKBQ2JWQ@2] Running shell script
      [parallel-2 overrides environment variables] + java -version
      [parallel-2 overrides environment variables] java version "1.7.0_80"
      [parallel-2 overrides environment variables] Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
      [parallel-2 overrides environment variables] Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
      [Pipeline] [parallel-2 overrides environment variables] echo
      [parallel-2 overrides environment variables] Let's check our environment variables
      [Pipeline] [parallel-2 overrides environment variables] echo
      [parallel-2 overrides environment variables] This has been inherited!
      [Pipeline] [parallel-2 overrides environment variables] echo
      [parallel-2 overrides environment variables] YES --> Overridden by parallel-2
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] [parallel-2 overrides environment variables] // withEnv
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] [parallel-2 overrides environment variables] // withEnv
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] [parallel-2 overrides environment variables] // withEnv
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] [parallel-2 overrides environment variables] // node
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] [parallel-2 overrides environment variables] // stage
      [Pipeline] [parallel-2 overrides environment variables] }
      [Pipeline] // parallel
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Declarative: Post Actions)
      [Pipeline] echo
      ALWAYS --> Runs all the time.
      [Pipeline] echo
      FAILURE --> Failed. Womp womp.
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // timestamps
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      
      GitHub has been notified of this commit’s build result
      
      an exception which occurred:
      	in field locals
      	in field parent
      	in field caller
      	in field parent
      	in field parent
      	in field caller
      	in field parent
      	in field caller
      	in field e
      	in field program
      	in field threads
      	in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@4d857434
      Caused: java.io.NotSerializableException: java.util.TreeMap$Entry
      	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
      	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.HashMap.internalWriteEntries(HashMap.java:1777)
      	at java.util.HashMap.writeObject(HashMap.java:1354)
      	at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	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.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.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.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.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.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.GeneratedMethodAccessor377.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	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:140)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:434)
      	at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:529)
      	at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:525)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:744)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	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)
      Finished: FAILURE
      

        Attachments

        1. build-9.tgz
          33 kB
        2. generateImage.groovy
          3 kB
        3. image-2017-09-01-16-39-42-593.png
          image-2017-09-01-16-39-42-593.png
          692 kB
        4. Jenkinsfile
          4 kB
        5. jenkins-parallel-bug.jenkinsfile
          11 kB
        6. notifySlack.groovy
          1 kB

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            Ah-ha! Annoyingly I can't tell exactly where the problem is, but there's only so many places it could be involving a TreeMap$Entry, so I can figure this out later.

            Show
            abayer Andrew Bayer added a comment - Ah-ha! Annoyingly I can't tell exactly where the problem is, but there's only so many places it could be involving a TreeMap$Entry , so I can figure this out later.
            Hide
            jboerner Jon B added a comment - - edited

            This same error is happening to me every run after my latest upgrade. Unfortunately I am finding it difficult to figure out which combination of upgraded plugins made it start happening. I don't have a parallel step in my pipeline, and ruled out any shared library causes. Happy to give more info if I was told what would be useful.

             

            Downgrading to 1.1.9 (and downgrading the associated plugins to 1.1.9) makes it work fine

            Show
            jboerner Jon B added a comment - - edited This same error is happening to me every run after my latest upgrade. Unfortunately I am finding it difficult to figure out which combination of upgraded plugins made it start happening. I don't have a parallel step in my pipeline, and ruled out any shared library causes. Happy to give more info if I was told what would be useful.   Downgrading to 1.1.9 (and downgrading the associated plugins to 1.1.9) makes it work fine
            Hide
            abayer Andrew Bayer added a comment -

            PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/208 which gets rid of the last TreeMap in the runtime, which should fix this. I think.

            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/208 which gets rid of the last TreeMap in the runtime, which should fix this. I think.
            Hide
            samirageb Sami Rageb added a comment - - edited

            11/11 Update: Andrew Bayer not sure if you saw this comment or not...

            Using v1.2.3 (includes the PR that got pushed) improved the condition for me, but still occurs, albeit less. I was having it happen 90% of builds, now closer to 20%. Note that I have a parameterized my 6 parallel stages, and this behavior is occurring when I do a skip on all 6. So basically each quickly evals and moves on.

            My environment:
            -Ubuntu 16.04.3 w4.9.x kernel
            -Jenkins 2.8.7
            -Declaritive pipeline - Latest (1.2.3) - All pipeline plugins updated to latest stable
            -Jenkins file is declarative
            -Snippet below

            [Pipeline] // parallel
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // ansiColor
            [Pipeline] End of Pipeline
            an exception which occurred:
            	in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals
            	in object com.cloudbees.groovy.cps.impl.LoopBlockScopeEnv@232d752b
            	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@519fe969
            	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            	in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@2402d18
            	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@3ba577c4
            	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@15e1ce09
            	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            	in object com.cloudbees.groovy.cps.impl.ClosureCallEnv@c0a7ecd
            	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@2daa9019
            	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            	in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@5f2f9f5a
            	in field com.cloudbees.groovy.cps.Continuable.e
            	in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@632ba972
            	in field org.jenkinsci.plugins.workflow.cps.CpsThread.program
            	in object org.jenkinsci.plugins.workflow.cps.CpsThread@110849d8
            	in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.threads
            	in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@56c025ed
            	in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@56c025ed
            Caused: java.io.NotSerializableException: java.util.TreeMap$Entry
            	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            	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.HashMap.internalWriteEntries(HashMap.java:1785)
            	at java.util.HashMap.writeObject(HashMap.java:1362)
            	at sun.reflect.GeneratedMethodAccessor30.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:273)
            	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.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.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.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.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.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:2438)
            	at sun.reflect.GeneratedMethodAccessor216.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:273)
            	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:140)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:434)
            	at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:529)
            	at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:525)
            	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:745)
            	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
            	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            	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:1149)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            	at java.lang.Thread.run(Thread.java:748)
            Finished: FAILURE

             

            Show
            samirageb Sami Rageb added a comment - - edited 11/11 Update: Andrew Bayer not sure if you saw this comment or not... Using v1.2.3 (includes the PR that got pushed) improved the condition for me, but still occurs, albeit less. I was having it happen 90% of builds, now closer to 20%. Note that I have a parameterized my 6 parallel stages, and this behavior is occurring when I do a skip on all 6. So basically each quickly evals and moves on. My environment: -Ubuntu 16.04.3 w4.9.x kernel -Jenkins 2.8.7 -Declaritive pipeline - Latest (1.2.3) - All pipeline plugins updated to latest stable -Jenkins file is declarative -Snippet below [Pipeline] // parallel [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // ansiColor [Pipeline] End of Pipeline an exception which occurred: in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals in object com.cloudbees.groovy.cps.impl.LoopBlockScopeEnv@232d752b in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@519fe969 in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@2402d18 in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@3ba577c4 in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@15e1ce09 in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.ClosureCallEnv@c0a7ecd in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@2daa9019 in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@5f2f9f5a in field com.cloudbees.groovy.cps.Continuable.e in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@632ba972 in field org.jenkinsci.plugins.workflow.cps.CpsThread.program in object org.jenkinsci.plugins.workflow.cps.CpsThread@110849d8 in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.threads in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@56c025ed in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@56c025ed Caused: java.io.NotSerializableException: java.util.TreeMap$Entry at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) 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.HashMap.internalWriteEntries(HashMap.java:1785) at java.util.HashMap.writeObject(HashMap.java:1362) at sun.reflect.GeneratedMethodAccessor30.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:273) 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.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.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.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.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.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:2438) at sun.reflect.GeneratedMethodAccessor216.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:273) 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:140) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:434) at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:529) at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:525) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:745) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE  
            Hide
            abayer Andrew Bayer added a comment -

            Any chance you could pst a Jenkinsfile that can reproduce this?

            Show
            abayer Andrew Bayer added a comment - Any chance you could pst a Jenkinsfile that can reproduce this?
            Hide
            samirageb Sami Rageb added a comment - - edited

            Andrew Bayer - See attached.

            I've redacted a few pieces of information with '*****', obviously I'm using a shared lib so I've included the relevant groovy files. Hopefully this helps.

            Also, the issue is repro'd with default parameters, so typically all parallel steps are left false. I notice that removing the post-step (pipeline level) tends to make the builds pass successfully much more frequently.

            Thanks.

            Show
            samirageb Sami Rageb added a comment - - edited Andrew Bayer - See attached. jenkins-parallel-bug.jenkinsfile notifySlack.groovy   generateImage.groovy I've redacted a few pieces of information with '*****', obviously I'm using a shared lib so I've included the relevant groovy files. Hopefully this helps. Also, the issue is repro'd with default parameters, so typically all parallel steps are left false. I notice that removing the post-step (pipeline level) tends to make the builds pass successfully much more frequently. Thanks.
            Hide
            abayer Andrew Bayer added a comment -

            Sami Rageb And you're able to reproduce the failure fairly consistently? And the failure's always showing up when it gets to the parallel stages, all of which don't actually run?

            Show
            abayer Andrew Bayer added a comment - Sami Rageb And you're able to reproduce the failure fairly consistently? And the failure's always showing up when it gets to the parallel stages, all of which don't actually run?
            Hide
            abayer Andrew Bayer added a comment -

            Ah-haaaaaa. Found it, I think. There are two issues, though only one of them may be impacting you directly. With newer cores and workflow-scm-step versions, Declarative captures the environment variables returned by the checkout step and adds them to the environment...and checkout returns a TreeMap. So with enough parallel stages, eventually one of them happens to be at the brief moment where the TreeMap is in memory at serialization time and then boom.

            I also independently discovered that .every is still using a BooleanClosureWrapper, even though I thought I'd forced that to always use a serializable CpsBooleanClosureWrapper. That's not causing your error (I hit it trying to reproduce this by adding sleep 1 inside a when expression and getting hit by serialization errors), but I'm bundling in a workaround for that to this fix just to be safe.

            Show
            abayer Andrew Bayer added a comment - Ah-haaaaaa. Found it, I think. There are two issues, though only one of them may be impacting you directly. With newer cores and workflow-scm-step versions, Declarative captures the environment variables returned by the checkout step and adds them to the environment...and checkout returns a TreeMap . So with enough parallel stages, eventually one of them happens to be at the brief moment where the TreeMap is in memory at serialization time and then boom. I also independently discovered that .every is still using a BooleanClosureWrapper , even though I thought I'd forced that to always use a serializable CpsBooleanClosureWrapper . That's not causing your error (I hit it trying to reproduce this by adding sleep 1 inside a when expression and getting hit by serialization errors), but I'm bundling in a workaround for that to this fix just to be safe.
            Hide
            abayer Andrew Bayer added a comment -

            Slight goofiness on my part - the BooleanClosureWrapper-related failures go away when you're on workflow-cps 2.41 or newer. So in https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/218, I bumped that accordingly.

            Anyway, thanks for the reproduction case - here's hoping no more of these show up!

            Show
            abayer Andrew Bayer added a comment - Slight goofiness on my part - the BooleanClosureWrapper -related failures go away when you're on workflow-cps 2.41 or newer. So in https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/218 , I bumped that accordingly. Anyway, thanks for the reproduction case - here's hoping no more of these show up!
            Hide
            samirageb Sami Rageb added a comment - - edited

            Hey Andrew Bayer Just saw these last 2 posts. Is there anything I can do to avoid the checkout from actually occurring per parallel stage? Even though the stage gets skipped, the output still shows as though the checkout occurred. (I confess I haven't checked the workspace on disk however)

            I'm happy to help provide any additional information you require, and thank you for your responsiveness and attention to this issue!!

             

            The output for the relevant parallel stage:

            [Pipeline] stage
            [Pipeline] { (Image Create: Global)
            [Pipeline] parallel
            [Pipeline] [CAE] { (Branch: CAE)
            [Pipeline] [EAS] { (Branch: EAS)
            [Pipeline] [EUS] { (Branch: EUS)
            [Pipeline] [SCUS] { (Branch: SCUS)
            [Pipeline] [UKS] { (Branch: UKS)
            [Pipeline] [WEU] { (Branch: WEU)
            [Pipeline] [CAE] stage
            [Pipeline] [CAE] { (CAE)
            [Pipeline] [EAS] stage
            [Pipeline] [EAS] { (EAS)
            [Pipeline] [EUS] stage
            [Pipeline] [EUS] { (EUS)
            [Pipeline] [SCUS] stage
            [Pipeline] [SCUS] { (SCUS)
            [Pipeline] [UKS] stage
            [Pipeline] [UKS] { (UKS)
            [Pipeline] [WEU] stage
            [Pipeline] [WEU] { (WEU)
            [Pipeline] [CAE] node
            [CAE] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline
            [Pipeline] [EAS] node
            [EAS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@2
            [Pipeline] [EUS] node
            [EUS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@3
            [Pipeline] [SCUS] node
            [SCUS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@5
            [Pipeline] [UKS] node
            [UKS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@4
            [Pipeline] [WEU] node
            [WEU] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@6
            [Pipeline] [CAE] {
            [Pipeline] [EAS] {
            [Pipeline] [EUS] {
            [Pipeline] [UKS] {
            [Pipeline] [SCUS] {
            [Pipeline] [WEU] {
            [Pipeline] [CAE] checkout
            [CAE] > git rev-parse --is-inside-work-tree # timeout=10
            [CAE] Fetching changes from the remote Git repository
            [CAE] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [CAE] Cleaning workspace
            [CAE] > git rev-parse --verify HEAD # timeout=10
            [CAE] Resetting working tree
            [CAE] > git reset --hard # timeout=10
            [CAE] > git clean -fdx # timeout=10
            [Pipeline] [EAS] checkout
            [EAS] > git rev-parse --is-inside-work-tree # timeout=10
            [EAS] Fetching changes from the remote Git repository
            [EAS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [EAS] Cleaning workspace
            [EAS] > git rev-parse --verify HEAD # timeout=10
            [EAS] Resetting working tree
            [EAS] > git reset --hard # timeout=10
            [Pipeline] [EUS] checkout
            [EUS] > git rev-parse --is-inside-work-tree # timeout=10
            [EUS] Fetching changes from the remote Git repository
            [EUS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [Pipeline] [UKS] checkout
            [UKS] > git rev-parse --is-inside-work-tree # timeout=10
            [UKS] Fetching changes from the remote Git repository
            [UKS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [UKS] Cleaning workspace
            [UKS] > git rev-parse --verify HEAD # timeout=10
            [UKS] Resetting working tree
            [UKS] > git reset --hard # timeout=10
            [Pipeline] [SCUS] checkout
            [SCUS] > git rev-parse --is-inside-work-tree # timeout=10
            [SCUS] Fetching changes from the remote Git repository
            [SCUS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [Pipeline] [WEU] checkout
            [CAE] Fetching upstream changes from git@bitbucket.org:***.git
            [CAE] > git --version # timeout=10
            [CAE] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [CAE] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [EAS] > git clean -fdx # timeout=10
            [EAS] Fetching upstream changes from git@bitbucket.org:***.git
            [EAS] > git --version # timeout=10
            [EAS] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [EAS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [EUS] Cleaning workspace
            [EUS] > git rev-parse --verify HEAD # timeout=10
            [EUS] Resetting working tree
            [EUS] > git reset --hard # timeout=10
            [EUS] > git clean -fdx # timeout=10
            [EUS] Fetching upstream changes from git@bitbucket.org:***.git
            [EUS] > git --version # timeout=10
            [EUS] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [EUS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [UKS] > git clean -fdx # timeout=10
            [UKS] Fetching upstream changes from git@bitbucket.org:***.git
            [UKS] > git --version # timeout=10
            [UKS] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [UKS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [SCUS] Cleaning workspace
            [SCUS] > git rev-parse --verify HEAD # timeout=10
            [SCUS] Resetting working tree
            [SCUS] > git reset --hard # timeout=10
            [SCUS] > git clean -fdx # timeout=10
            [SCUS] Fetching upstream changes from git@bitbucket.org:***.git
            [SCUS] > git --version # timeout=10
            [SCUS] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [SCUS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [WEU] > git rev-parse --is-inside-work-tree # timeout=10
            [WEU] Fetching changes from the remote Git repository
            [WEU] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10
            [WEU] Cleaning workspace
            [WEU] > git rev-parse --verify HEAD # timeout=10
            [WEU] Resetting working tree
            [WEU] > git reset --hard # timeout=10
            [WEU] > git clean -fdx # timeout=10
            [WEU] Fetching upstream changes from git@bitbucket.org:***.git
            [WEU] > git --version # timeout=10
            [WEU] using GIT_SSH to set credentials Bitbucket Deploy Creds
            [WEU] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/*
            [CAE] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [CAE] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [CAE] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [CAE] > git config core.sparsecheckout # timeout=10
            [CAE] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e
            [CAE] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix"
            [Pipeline] [CAE] withEnv
            [Pipeline] [CAE] {
            Stage 'CAE' skipped due to when conditional
            [Pipeline] [CAE] }
            [Pipeline] [CAE] // withEnv
            [Pipeline] [CAE] }
            [Pipeline] [CAE] // node
            [Pipeline] [CAE] }
            [Pipeline] [CAE] // stage
            [Pipeline] [CAE] }
            [EUS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [EUS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [EUS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [EUS] > git config core.sparsecheckout # timeout=10
            [EUS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e
            [EUS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix"
            [Pipeline] [EUS] withEnv
            [Pipeline] [EUS] {
            Stage 'EUS' skipped due to when conditional
            [Pipeline] [EUS] }
            [Pipeline] [EUS] // withEnv
            [Pipeline] [EUS] }
            [Pipeline] [EUS] // node
            [Pipeline] [EUS] }
            [Pipeline] [EUS] // stage
            [Pipeline] [EUS] }
            [UKS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [UKS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [UKS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [UKS] > git config core.sparsecheckout # timeout=10
            [UKS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e
            [SCUS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [SCUS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [UKS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix"
            [SCUS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [SCUS] > git config core.sparsecheckout # timeout=10
            [SCUS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e
            [Pipeline] [UKS] withEnv
            [Pipeline] [UKS] {
            Stage 'UKS' skipped due to when conditional
            [WEU] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [Pipeline] [UKS] }
            [EAS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
            [SCUS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix"
            [WEU] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [Pipeline] [UKS] // withEnv
            [EAS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
            [WEU] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [WEU] > git config core.sparsecheckout # timeout=10
            [Pipeline] [UKS] }
            [Pipeline] [UKS] // node
            [Pipeline] [UKS] }
            [Pipeline] [WEU] }
            [EAS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master)
            [EAS] > git config core.sparsecheckout # timeout=10
            [EAS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e
            [Pipeline] [SCUS] withEnv
            [Pipeline] [SCUS] {
            [EAS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix"
            [Pipeline] [UKS] // stage
            [Pipeline] [WEU] // node
            [Pipeline] [UKS] }
            [Pipeline] [WEU] }
            Stage 'SCUS' skipped due to when conditional
            [Pipeline] [WEU] // stage
            [Pipeline] [WEU] }
            [WEU] Failed in branch WEU
            [Pipeline] [EAS] withEnv
            [Pipeline] [EAS] {
            [Pipeline] [SCUS] }
            Stage 'EAS' skipped due to when conditional
            [Pipeline] [SCUS] // withEnv
            [Pipeline] [SCUS] }
            [Pipeline] [EAS] }
            [Pipeline] [SCUS] // node
            [Pipeline] [SCUS] }
            [Pipeline] [EAS] // withEnv
            [Pipeline] [EAS] }
            [Pipeline] [SCUS] // stage
            [Pipeline] [SCUS] }
            [Pipeline] [EAS] // node
            [Pipeline] [EAS] }
            [Pipeline] [EAS] // stage
            [Pipeline] [EAS] }
            [Pipeline] // parallel
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (Declarative: Post Actions)
            [Pipeline] echo
            Notifying Slack - END
            [Pipeline] slackSend
            run slackstepsend, step null:false, desc :false
            Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: false, color: false
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // ansiColor
            [Pipeline] End of Pipeline
            an exception which occurred:
            in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals
            in object com.cloudbees.groovy.cps.impl.LoopBlockScopeEnv@7c8b030c
            in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@72151b82
            in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@5e51fc9c
            in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@2e41812d
            in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@3bf0ce03
            in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            in object com.cloudbees.groovy.cps.impl.ClosureCallEnv@864a3c6
            in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
            in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@4df3001d
            in field com.cloudbees.groovy.cps.impl.CallEnv.caller
            in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@7acd041a
            in field com.cloudbees.groovy.cps.Continuable.e
            in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@2aea5382
            in field org.jenkinsci.plugins.workflow.cps.CpsThread.program
            in object org.jenkinsci.plugins.workflow.cps.CpsThread@69f808df
            in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.threads
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@6bf8b8ea
            in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@6bf8b8ea
            Caused: java.io.NotSerializableException: java.util.TreeMap$Entry
            at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
            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.HashMap.internalWriteEntries(HashMap.java:1790)
            at java.util.HashMap.writeObject(HashMap.java:1363)
            at sun.reflect.GeneratedMethodAccessor29.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:273)
            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.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.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.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.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.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:2438)
            at sun.reflect.GeneratedMethodAccessor344.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:273)
            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:140)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:434)
            at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:529)
            at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:525)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:745)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            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:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
            Finished: FAILURE
            Show
            samirageb Sami Rageb added a comment - - edited Hey Andrew Bayer Just saw these last 2 posts. Is there anything I can do to avoid the checkout from actually occurring per parallel stage? Even though the stage gets skipped, the output still shows as though the checkout occurred. (I confess I haven't checked the workspace on disk however) I'm happy to help provide any additional information you require, and thank you for your responsiveness and attention to this issue!!   The output for the relevant parallel stage: [Pipeline] stage [Pipeline] { (Image Create: Global) [Pipeline] parallel [Pipeline] [CAE] { (Branch: CAE) [Pipeline] [EAS] { (Branch: EAS) [Pipeline] [EUS] { (Branch: EUS) [Pipeline] [SCUS] { (Branch: SCUS) [Pipeline] [UKS] { (Branch: UKS) [Pipeline] [WEU] { (Branch: WEU) [Pipeline] [CAE] stage [Pipeline] [CAE] { (CAE) [Pipeline] [EAS] stage [Pipeline] [EAS] { (EAS) [Pipeline] [EUS] stage [Pipeline] [EUS] { (EUS) [Pipeline] [SCUS] stage [Pipeline] [SCUS] { (SCUS) [Pipeline] [UKS] stage [Pipeline] [UKS] { (UKS) [Pipeline] [WEU] stage [Pipeline] [WEU] { (WEU) [Pipeline] [CAE] node [CAE] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline [Pipeline] [EAS] node [EAS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@2 [Pipeline] [EUS] node [EUS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@3 [Pipeline] [SCUS] node [SCUS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@5 [Pipeline] [UKS] node [UKS] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@4 [Pipeline] [WEU] node [WEU] Running on Jenkins in /datadrive/jenkins/home/workspace/bake.azure.base.pipeline@6 [Pipeline] [CAE] { [Pipeline] [EAS] { [Pipeline] [EUS] { [Pipeline] [UKS] { [Pipeline] [SCUS] { [Pipeline] [WEU] { [Pipeline] [CAE] checkout [CAE] > git rev-parse --is-inside-work-tree # timeout=10 [CAE] Fetching changes from the remote Git repository [CAE] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [CAE] Cleaning workspace [CAE] > git rev-parse --verify HEAD # timeout=10 [CAE] Resetting working tree [CAE] > git reset --hard # timeout=10 [CAE] > git clean -fdx # timeout=10 [Pipeline] [EAS] checkout [EAS] > git rev-parse --is-inside-work-tree # timeout=10 [EAS] Fetching changes from the remote Git repository [EAS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [EAS] Cleaning workspace [EAS] > git rev-parse --verify HEAD # timeout=10 [EAS] Resetting working tree [EAS] > git reset --hard # timeout=10 [Pipeline] [EUS] checkout [EUS] > git rev-parse --is-inside-work-tree # timeout=10 [EUS] Fetching changes from the remote Git repository [EUS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [Pipeline] [UKS] checkout [UKS] > git rev-parse --is-inside-work-tree # timeout=10 [UKS] Fetching changes from the remote Git repository [UKS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [UKS] Cleaning workspace [UKS] > git rev-parse --verify HEAD # timeout=10 [UKS] Resetting working tree [UKS] > git reset --hard # timeout=10 [Pipeline] [SCUS] checkout [SCUS] > git rev-parse --is-inside-work-tree # timeout=10 [SCUS] Fetching changes from the remote Git repository [SCUS] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [Pipeline] [WEU] checkout [CAE] Fetching upstream changes from git@bitbucket.org:***.git [CAE] > git --version # timeout=10 [CAE] using GIT_SSH to set credentials Bitbucket Deploy Creds [CAE] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [EAS] > git clean -fdx # timeout=10 [EAS] Fetching upstream changes from git@bitbucket.org:***.git [EAS] > git --version # timeout=10 [EAS] using GIT_SSH to set credentials Bitbucket Deploy Creds [EAS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [EUS] Cleaning workspace [EUS] > git rev-parse --verify HEAD # timeout=10 [EUS] Resetting working tree [EUS] > git reset --hard # timeout=10 [EUS] > git clean -fdx # timeout=10 [EUS] Fetching upstream changes from git@bitbucket.org:***.git [EUS] > git --version # timeout=10 [EUS] using GIT_SSH to set credentials Bitbucket Deploy Creds [EUS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [UKS] > git clean -fdx # timeout=10 [UKS] Fetching upstream changes from git@bitbucket.org:***.git [UKS] > git --version # timeout=10 [UKS] using GIT_SSH to set credentials Bitbucket Deploy Creds [UKS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [SCUS] Cleaning workspace [SCUS] > git rev-parse --verify HEAD # timeout=10 [SCUS] Resetting working tree [SCUS] > git reset --hard # timeout=10 [SCUS] > git clean -fdx # timeout=10 [SCUS] Fetching upstream changes from git@bitbucket.org:***.git [SCUS] > git --version # timeout=10 [SCUS] using GIT_SSH to set credentials Bitbucket Deploy Creds [SCUS] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [WEU] > git rev-parse --is-inside-work-tree # timeout=10 [WEU] Fetching changes from the remote Git repository [WEU] > git config remote.origin.url git@bitbucket.org:***.git # timeout=10 [WEU] Cleaning workspace [WEU] > git rev-parse --verify HEAD # timeout=10 [WEU] Resetting working tree [WEU] > git reset --hard # timeout=10 [WEU] > git clean -fdx # timeout=10 [WEU] Fetching upstream changes from git@bitbucket.org:***.git [WEU] > git --version # timeout=10 [WEU] using GIT_SSH to set credentials Bitbucket Deploy Creds [WEU] > git fetch --tags --progress git@bitbucket.org:***.git +refs/heads/*:refs/remotes/origin/* [CAE] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [CAE] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [CAE] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [CAE] > git config core.sparsecheckout # timeout=10 [CAE] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e [CAE] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix" [Pipeline] [CAE] withEnv [Pipeline] [CAE] { Stage 'CAE' skipped due to when conditional [Pipeline] [CAE] } [Pipeline] [CAE] // withEnv [Pipeline] [CAE] } [Pipeline] [CAE] // node [Pipeline] [CAE] } [Pipeline] [CAE] // stage [Pipeline] [CAE] } [EUS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [EUS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [EUS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [EUS] > git config core.sparsecheckout # timeout=10 [EUS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e [EUS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix" [Pipeline] [EUS] withEnv [Pipeline] [EUS] { Stage 'EUS' skipped due to when conditional [Pipeline] [EUS] } [Pipeline] [EUS] // withEnv [Pipeline] [EUS] } [Pipeline] [EUS] // node [Pipeline] [EUS] } [Pipeline] [EUS] // stage [Pipeline] [EUS] } [UKS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [UKS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [UKS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [UKS] > git config core.sparsecheckout # timeout=10 [UKS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e [SCUS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [SCUS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [UKS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix" [SCUS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [SCUS] > git config core.sparsecheckout # timeout=10 [SCUS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e [Pipeline] [UKS] withEnv [Pipeline] [UKS] { Stage 'UKS' skipped due to when conditional [WEU] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [Pipeline] [UKS] } [EAS] > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 [SCUS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix" [WEU] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [Pipeline] [UKS] // withEnv [EAS] > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 [WEU] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [WEU] > git config core.sparsecheckout # timeout=10 [Pipeline] [UKS] } [Pipeline] [UKS] // node [Pipeline] [UKS] } [Pipeline] [WEU] } [EAS] Checking out Revision 6b10d7fbdf2bb7993aaddc4d32260a49745b310e (refs/remotes/origin/master) [EAS] > git config core.sparsecheckout # timeout=10 [EAS] > git checkout -f 6b10d7fbdf2bb7993aaddc4d32260a49745b310e [Pipeline] [SCUS] withEnv [Pipeline] [SCUS] { [EAS] Commit message: "Re-introduce slack post-build notify Test to see if this breaks the jenkins builds post-jenkins bugfix" [Pipeline] [UKS] // stage [Pipeline] [WEU] // node [Pipeline] [UKS] } [Pipeline] [WEU] } Stage 'SCUS' skipped due to when conditional [Pipeline] [WEU] // stage [Pipeline] [WEU] } [WEU] Failed in branch WEU [Pipeline] [EAS] withEnv [Pipeline] [EAS] { [Pipeline] [SCUS] } Stage 'EAS' skipped due to when conditional [Pipeline] [SCUS] // withEnv [Pipeline] [SCUS] } [Pipeline] [EAS] } [Pipeline] [SCUS] // node [Pipeline] [SCUS] } [Pipeline] [EAS] // withEnv [Pipeline] [EAS] } [Pipeline] [SCUS] // stage [Pipeline] [SCUS] } [Pipeline] [EAS] // node [Pipeline] [EAS] } [Pipeline] [EAS] // stage [Pipeline] [EAS] } [Pipeline] // parallel [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Declarative: Post Actions) [Pipeline] echo Notifying Slack - END [Pipeline] slackSend run slackstepsend, step null:false, desc :false Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: false, color: false [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // ansiColor [Pipeline] End of Pipeline an exception which occurred: in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals in object com.cloudbees.groovy.cps.impl.LoopBlockScopeEnv@7c8b030c in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@72151b82 in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@5e51fc9c in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@2e41812d in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@3bf0ce03 in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.ClosureCallEnv@864a3c6 in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@4df3001d in field com.cloudbees.groovy.cps.impl.CallEnv.caller in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@7acd041a in field com.cloudbees.groovy.cps.Continuable.e in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@2aea5382 in field org.jenkinsci.plugins.workflow.cps.CpsThread.program in object org.jenkinsci.plugins.workflow.cps.CpsThread@69f808df in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.threads in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@6bf8b8ea in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@6bf8b8ea Caused: java.io.NotSerializableException: java.util.TreeMap$Entry at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860) 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.HashMap.internalWriteEntries(HashMap.java:1790) at java.util.HashMap.writeObject(HashMap.java:1363) at sun.reflect.GeneratedMethodAccessor29.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:273) 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.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.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.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.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.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:2438) at sun.reflect.GeneratedMethodAccessor344.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:273) 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:140) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:458) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:434) at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:529) at org.jenkinsci.plugins.workflow.cps.CpsStepContext$3.onSuccess(CpsStepContext.java:525) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:745) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE
            Hide
            abayer Andrew Bayer added a comment -

            So Declarative does a checkout automatically on every stage that's on a new agent - I've been thinking about adding a way to turn that off per-stage (you can turn that off globally with the skipDefaultCheckout(true) option) but haven't gotten comfortable with the syntax yet.

            Show
            abayer Andrew Bayer added a comment - So Declarative does a checkout automatically on every stage that's on a new agent - I've been thinking about adding a way to turn that off per-stage (you can turn that off globally with the skipDefaultCheckout(true) option ) but haven't gotten comfortable with the syntax yet.
            Hide
            samirageb Sami Rageb added a comment -

            Ahh, so I think there are 2 distinct scenarios here:
            -Auto checkout / stage
            -Conditionally checkout

            In my case, the entire stage is skipped utilizing the 'when' condition, so I would think default behavior would be no behavior at all, regardless of the flag. It seems as though the checkout doesn't consider the when clause.

            With your suggestion, it seems I would need to explicitly call checkout per stage and within a scripted 'if' statement, if I wanted to do it conditionally, correct?

            This is all very helpful, btw.

            Show
            samirageb Sami Rageb added a comment - Ahh, so I think there are 2 distinct scenarios here: -Auto checkout / stage -Conditionally checkout In my case, the entire stage is skipped utilizing the 'when' condition, so I would think default behavior would be no behavior at all, regardless of the flag. It seems as though the checkout doesn't consider the when clause. With your suggestion, it seems I would need to explicitly call checkout per stage and within a scripted 'if' statement, if I wanted to do it conditionally, correct? This is all very helpful, btw.
            Hide
            abayer Andrew Bayer added a comment -

            Yeah, we do do the checkout before we get to the when evaluation - in case the SCM/checkout/repo/etc is needed to evaluate the when. I'd rather checkout too much than too little. =)

            And yes, if you use skipDefaultCheckout(true), you'd need to add an scm checkout at the beginning of any stage you want the source checked out for.

            Show
            abayer Andrew Bayer added a comment - Yeah, we do do the checkout before we get to the when evaluation - in case the SCM/checkout/repo/etc is needed to evaluate the when . I'd rather checkout too much than too little. =) And yes, if you use skipDefaultCheckout(true) , you'd need to add an scm checkout at the beginning of any stage you want the source checked out for.
            Hide
            samirageb Sami Rageb added a comment -

            Roger that. Thank you.

            Show
            samirageb Sami Rageb added a comment - Roger that. Thank you.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/AllOfConditionalScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/AnyOfConditionalScript.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
            pipeline-model-definition/src/test/resources/parallelStagesShouldntTriggerNSE.groovy
            pipeline-model-extensions/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy
            pom.xml
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/107bb5c7d02906d9ce82b863923818d68c4d942e
            Log:
            [FIXED JENKINS-46597] Further handling of serializability issues

            Specifically: the checkout step returns a TreeMap, so let's make sure
            we never have a variable assigned directly to that return
            value. Probably want to change checkout to return a HashMap in the
            future, but we'll cross that bridge later.

            Also updated workflow-cps dependency so that we can be sure
            BooleanClosureWrapper serialization issues won't crop up, letting us
            write more things as .every or .any.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/AllOfConditionalScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/AnyOfConditionalScript.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java pipeline-model-definition/src/test/resources/parallelStagesShouldntTriggerNSE.groovy pipeline-model-extensions/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/CheckoutScript.groovy pom.xml http://jenkins-ci.org/commit/pipeline-model-definition-plugin/107bb5c7d02906d9ce82b863923818d68c4d942e Log: [FIXED JENKINS-46597] Further handling of serializability issues Specifically: the checkout step returns a TreeMap, so let's make sure we never have a variable assigned directly to that return value. Probably want to change checkout to return a HashMap in the future, but we'll cross that bridge later. Also updated workflow-cps dependency so that we can be sure BooleanClosureWrapper serialization issues won't crop up, letting us write more things as .every or .any.
            Hide
            johnlengeling John Lengeling added a comment -

            We were seeing the same issues with treemap errors and notserializable exceptions when using multiple parallel steps.  We are running 2.73.1 and v1.2.4 pipeline-model-definition-plugins.   We were seeing about 40% of our builds failing due to this error.

            I installed the latest 1.2.5-SNAPSHOT of pipeline-model-definition-plugins to get the fix for JENKINS-46597.   

            The issues seems solved for us as we have not seen this error since installing the 1.2.5-SNAPSHOT version of the plugins.

            Show
            johnlengeling John Lengeling added a comment - We were seeing the same issues with treemap errors and notserializable exceptions when using multiple parallel steps.  We are running 2.73.1 and v1.2.4 pipeline-model-definition-plugins.   We were seeing about 40% of our builds failing due to this error. I installed the latest 1.2.5-SNAPSHOT of pipeline-model-definition-plugins to get the fix for JENKINS-46597 .    The issues seems solved for us as we have not seen this error since installing the 1.2.5-SNAPSHOT version of the plugins.
            Hide
            roel0 roel postelmans added a comment -

            The latest snapshot doesn't fixes this issue for me...

            Show
            roel0 roel postelmans added a comment - The latest snapshot doesn't fixes this issue for me...
            Hide
            abayer Andrew Bayer added a comment -

            roel postelmans - can you please attach your Jenkinsfile and the stacktrace? Thanks.

            Show
            abayer Andrew Bayer added a comment - roel postelmans - can you please attach your Jenkinsfile and the stacktrace? Thanks.
            Hide
            roel0 roel postelmans added a comment -

            I fixed it 5min ago.

            the problem was the storing of the return value of 'checkout scm' into a variable

            (I identified that by your commit message few comments up)

            Show
            roel0 roel postelmans added a comment - I fixed it 5min ago. the problem was the storing of the return value of 'checkout scm' into a variable (I identified that by your commit message few comments up)
            Hide
            abayer Andrew Bayer added a comment -

            Yeah, we really needed to fix the underlying problem over in scm - which I'm doing now in https://github.com/jenkinsci/workflow-scm-step-plugin/pull/23

            Show
            abayer Andrew Bayer added a comment - Yeah, we really needed to fix the underlying problem over in scm - which I'm doing now in https://github.com/jenkinsci/workflow-scm-step-plugin/pull/23
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/cps/persistence/IteratorHack.java
            src/test/java/org/jenkinsci/plugins/workflow/cps/persistence/IteratorHackTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/4ba68dad40dcd61ca2f50d08b65f45b307ef39b9
            Log:
            [FIXED JENKINS-46597] IteratorHack needs to special-case SortedMap

            For whatever reason that I can't exactly determine yet, Groovy
            categories seem to, at least in some scenarios, treat `Map` differently
            than `SortedMap`. I know, weird. Anyway, `IteratorHack#entrySet(Map)`
            and friends would fire for `HashMap` but not for `TreeMap`. Adding
            these shim methods fixes `entrySet`, `keySet`, and `values`.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/cps/persistence/IteratorHack.java src/test/java/org/jenkinsci/plugins/workflow/cps/persistence/IteratorHackTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/4ba68dad40dcd61ca2f50d08b65f45b307ef39b9 Log: [FIXED JENKINS-46597] IteratorHack needs to special-case SortedMap For whatever reason that I can't exactly determine yet, Groovy categories seem to, at least in some scenarios, treat `Map` differently than `SortedMap`. I know, weird. Anyway, `IteratorHack#entrySet(Map)` and friends would fire for `HashMap` but not for `TreeMap`. Adding these shim methods fixes `entrySet`, `keySet`, and `values`.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                kshultz Karl Shultz
              • Votes:
                1 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: