Might be related to
JENKINS-50470, some people commented there that they have this problem.
- Create a freestyle job
- Add "Execute system Groovy script" build step
- Add content (see below)
- Run build with "Use Groovy Sandbox" enabled.
- Run without "Use Groovy Sandbox" enabled
When the sandbox is enabled we have the following message :
ERROR: Build step failed with exceptionorg.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: No such field found: field hudson.slaves.EnvironmentVariablesNodeProperty size
It is not a field but a method, called without parentheses. It breaks many of our scripts, using methods such as first or size.
Thanks for your help !