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.