// troubleshooting guide · jenkins

Jenkins 'Scripts Not Permitted to Use Method' Error

Status
Workaround available
platforms:
Jenkins Pipeline
updated:
November 16, 2026
reports:
4
Method
how we research
Share

RUNBOOK · jenkins/scripts-not-permitted4 FIXES

// quick answer

The Groovy sandbox blocked a method in your pipeline. An admin approves the signature in Manage Jenkins > In-process Script Approval, or the code moves into a trusted shared library.

Most likely fix: Approve the signature

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Approve the signature

    1. 01As an admin go to Manage Jenkins > In-process Script Approval (or <jenkins URL>/scriptApproval/)
    2. 02Review the pending signature and click Approve only if it is safe
    3. 03Re-run the build; repeat for each new signature
    Did this fix it?
  2. FIX 2Rethrow caught rejections

    1. 01If the method never appears on the approval page, check for try/catch blocks that swallow errors
    2. 02Catch org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException and rethrow it so it reaches the approval page
    Did this fix it?
  3. FIX 3Use a trusted shared library

    1. 01Move the code into a global shared library configured in Manage Jenkins > System > Global Trusted Pipeline Libraries
    2. 02Trusted library code runs outside the sandbox, so no per-method approval is needed
    Did this fix it?
  4. FIX 4Avoid the method

    1. 01Use a pipeline step instead (e.g. readJSON, readFile, sh) rather than raw Java APIs
    2. 02Update the Script Security plugin if an approved method keeps getting blocked
    Did this fix it?

SANDBOX · jenkins RUNS IN YOUR BROWSER

Try it: push, review, run CI and merge in a code host and cloud workspace

A hands-on Jenkins-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.

Symptoms

The pipeline fails with org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method ... (or staticMethod / new).

Why it happens

  • C-01Pipeline code calls a Java/Groovy method not on the sandbox allowlist
  • C-02The signature is pending but nobody approved it
  • C-03The rejection was caught in a try/catch so it never reached the approval page
  • C-04A Script Security plugin bug on older versions

// this guide also covers

  • scripts not permitted to use method
  • jenkins script approval
  • rejectedaccessexception jenkins
  • jenkins in-process script approval

Still not working?

If Jenkins keeps failing, you're not alone. See every Jenkins problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch Jenkins Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Jenkins errors

All 14 Jenkins errors and fixes →