Getting RejectedAccessException: Scripts not permitted to use staticMethod WorkflowScript cps

Issue

  • Jobs hanging with the following exception:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod WorkflowScript ___cps___4831756
	at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectStaticMethod(StaticWhitelist.java:189)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:160)
	at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:184)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:188)
	at org.kohsuke.groovy.sandbox.impl.Checker$checkedStaticCall.callStatic(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:222)
	at WorkflowScript.<clinit>(WorkflowScript)
	...
  • Manage Jenkins » In-process Script Approval is filled with WorkFlow cps signatures

Environment

Related Issues

Resolution

1. Make sure you have a backup of your JENKINS_HOME directory

2. Disable BeeKeeper in Manage Jenkins » Beekeeper Upgrade Assistant

  • For versions before 2.89.x.x uncheck Enroll this instance in the CloudBees Assurance Program and click Save

  • For versions after 2.89.x.x click on Configure or navigate to CAP Configuration

  • Uncheck Enroll this instance in the CloudBees Assurance Program and click Save

3. Upgrade Pipeline Job Plugin and Pipeline Groovy Plugin plugin to the latest version including any necessary dependencies in in Manage Jenkins » Manage Plugins

  • Restart Jenkins by clicking on Restart Jenkins when installation is complete and no jobs are running

4. Enable BeeKeeper in Manage Jenkins » Beekeeper Upgrade Assistant

  • For versions before 2.89.x.x check Enroll this instance in the CloudBees Assurance Program and click Save

  • For versions after 2.89.x.x click on Configure or navigate to CAP Configuration

  • Check Enroll this instance in the CloudBees Assurance Program and click Save

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.