`java.lang.IllegalArgumentException: Unsupported parameter type for sh` or `No signature of method: sh() is applicable for argument types: (java.lang.String, java.lang.Boolean)`
BeginnerTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer
Likely causes → Wrong step argument style: positional arguments mixed with named ones, e.g. sh('ls', true).
Diagnose → Check the Snippet Generator for the step's parameter names.
Fix → Use named parameters: sh(script: 'ls', returnStdout: true).
Prevent → Generate unfamiliar step syntax from the Snippet Generator.
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`java.io.NotSerializableException: groovy.json.internal.LazyMap`Intermediate`org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object`Intermediate