This is caused by a step execution in the Pipeline code that requires that a workspace be available - i.e. an agent and a workspace are allocated - but there is none.
The stacktrace helps to identify the line in the Script that causes the problem. For example here it is the line
172
in the main pipeline script:
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing
Perhaps you forgot to surround the code with a step that provides this, such as: node
[...]
at WorkflowScript.run(WorkflowScript:172)
at ___cps.transform___(Native Method)
Loaded Scripts / Shared Libraries
When this happens in a loaded script (from a shared library for example) the stacktrace is different and the line to look for is similar to
Script<scriptNumber>.<methodName>(Script<scriptNumber>.groovy:<lineNumber>)
. For example:
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing
Perhaps you forgot to surround the code with a step that provides this, such as: node
[...]
at Script1.myGlobalFunc(Script1.groovy:17)
at ___cps.transform___(Native Method)