`java.io.NotSerializableException: groovy.json.internal.LazyMap`
IntermediateTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer
Likely causes → new JsonSlurper().parseText(...) returns a LazyMap, which is not serializable, and it is alive across a step.
Diagnose → Search the Jenkinsfile and library for JsonSlurper.
Fix → Use Pipeline Utility Steps: def data = readJSON text: response (returns serializable JSONObject), or JsonSlurperClassic inside a @NonCPS method returning plain maps.
Prevent → Standardize on readJSON/readYaml in the library.
More on Jenkinsfile syntax, Groovy & CPS errors
`WorkflowScript: 1: Missing required section "agent" @ line 1, column 1.`Beginner`Unknown stage section "step". Starting with version 0.5, steps in a stage must be in a ‘steps’ block.`Beginner`java.lang.NoSuchMethodError: No such DSL method 'withSonarQubeEnv' found among steps [archive, bat, build, ...]`Beginner`java.io.NotSerializableException: java.util.regex.Matcher`Advanced`org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object`Intermediate`groovy.lang.MissingPropertyException: No such property: IMAGE_TAG for class: groovy.lang.Binding`Beginner