1

I have a pipeline which fails on script approval:

Scripts not permitted to use method org.jenkinsci.plugins.workflow.support.actions.EnvironmentAction getEnvironment. Administrators can decide whether to approve or reject this signature.
[Pipeline] End of Pipeline
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
[JobCompletedListener] Build result is: FAILURE
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method org.jenkinsci.plugins.workflow.support.actions.EnvironmentAction getEnvironment

I went to in scriptApproval screen, approved the below:

signature: method org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper getRawBuild     
signature: method java.net.URL getProtocol
signature: method java.lang.Throwable printStackTrace
signature: method org.jenkinsci.plugins.workflow.support.actions.EnvironmentAction getEnvironment

but on the next run I'm getting the exact same error, and approval request in scriptApproval screen, comes up again. any idea what is the root cause of this behavior? is there a workaround for it?

Jenkins is running as a container, and the Security plugin version is 1.60. BTW, the same job works perfect on other Jenkins which is VM

arielma
  • 339
  • 2
  • 9
  • 21

1 Answers1

1

The issue was with the wrong UID and GID of the user. after I've changed it from jenkins to 1000 1000 recursively, issue solved.

arielma
  • 339
  • 2
  • 9
  • 21
  • Can you elaborate? I experience the same issue. UID GID of user where? in the filesystem? can you explain? – Moshe Sep 30 '20 at 13:35