Why is my approved script getting a script not yet approved error?

Article ID:4412451663387
1 minute readKnowledge base

Issue

A script continuously needs to be approved despite listed as approved in scriptApproval.xml.

ERROR: Build step failed with exception
org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use

Resolution

Please open a support ticket at https://support.cloudbees.com with your support bundle and your scriptApproval.xml file, so we can diagnose this issue.

Workaround $

You can work-around this issue by re-adding your script:

  • Backup current $JENKINS_HOME/scriptApproval.xml.

  • Stop the Controller.

  • Modify the file and remove all references to the problematic method or script.

  • Start the Controller.

  • Run the build again and re-approve the method.

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.