Jenkins: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method java.lang.String toUpperCase
A sandboxed Pipeline script called a method that has not been approved in Script Security.
Scripts not permitted to use methodScripts not permitted to use newScripts not permitted to use staticMethod Meaning
Pipeline scripts run in a Groovy sandbox for safety. Unapproved methods are blocked until an administrator approves the signature at Manage Jenkins → In-process Script Approval. Safer fix: move the logic into a shared library (trusted) or use built-in steps.
Common causes
- Using Java/Groovy APIs not whitelisted in the sandbox
- Calling methods on arbitrary objects (e.g.
new File()) - New signature after a plugin update
- Script uses
@NonCPSor reflection - Shared library marked untrusted
⚡ Quick fix
- Approve the signature in Manage Jenkins → In-process Script Approval (review it first)
- Move logic into a trusted shared library
- Replace with pipeline steps (
readJSON,sh)
Detailed fix by platform
Jenkins
- Use
readJSON/writeFilesteps instead of Java IO - Review requests carefully — approval grants that call to all sandboxed scripts
How to diagnose
- Method — Which signature is rejected?
- Alternative — Is a Pipeline step available?
- Trust — Safe to approve?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ComparisonError: manifest generation failed Argo CD: ComparisonError: rpc error: code = Unknown desc = Manifest generation error (cached): kustomize build failed
- Could not find credentials entry Jenkins: ERROR: Could not find credentials entry with ID 'github-token'
- No such DSL method Jenkins: java.lang.NoSuchMethodError: No such DSL method 'dockerBuild' found among steps
Most viewed in CI/CD
- The process '/usr/bin/git' failed with exit code 128 GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128
- This job is stuck because you don't have any active runners GitLab CI: This job is stuck because you don't have any active runners online or available with any of these tags assigned to them
- Resource not accessible by integration GitHub Actions: Error: Resource not accessible by integration (403)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Oct 2026