[JIRA] (JENKINS-42023) UnapprovedUsageException: script not yet approved for use

148 views
Skip to first unread message

khakhin.tensor@gmail.com (JIRA)

unread,
Feb 14, 2017, 10:10:02 AM2/14/17
to jenkinsc...@googlegroups.com
Andrey Khakhin created an issue
 
Jenkins / Bug JENKINS-42023
UnapprovedUsageException: script not yet approved for use
Issue Type: Bug Bug
Assignee: Andrey Khakhin
Components: script-security-plugin
Created: 2017/Feb/14 3:09 PM
Environment: Jenkins ver. 2.32.2
Labels: pipeline script-security
Priority: Minor Minor
Reporter: Andrey Khakhin

I have the following code that unloads the pipeline script from SVN and runs the function
checkout([
$class: 'SubversionSCM',
locations: [[
credentialsId: env.CREDENTIAL_ID_SVN,
depthOption: 'infinity',
ignoreExternalsOption: true,
local: '.',
remote: env.TEMPLATE_PATH
]],
workspaceUpdater: [$class: 'UpdateUpdater']])

def builder = load 'runner_with_group_and_restart.groovy'
builder.run_jobs(jobs_map)

sometimes the assembly begins with the following exception:
org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval.using(ScriptApproval.java:459)
at org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition.create(CpsFlowDefinition.java:110)
at org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition.create(CpsFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE

Although scripts do not have changed and after a while everything starts to run

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Feb 27, 2017, 4:38:05 PM2/27/17
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Cannot Reproduce
 

Turn on sandbox mode. Whole-script-approval mode really should not be used any more.

As to why you would suddenly get an UnapprovedUsageException, I cannot guess without steps to reproduce from scratch.

Change By: Jesse Glick
Status: Open Resolved
Resolution: Cannot Reproduce

khakhin2@gmail.com (JIRA)

unread,
Feb 28, 2017, 3:37:01 AM2/28/17
to jenkinsc...@googlegroups.com
Andrey Khakhin commented on Bug JENKINS-42023
 
Re: UnapprovedUsageException: script not yet approved for use

Turn on sandbox mode - should be off, used
In a script, nothing else, only checkout, load the script and function call

raj333921@gmail.com (JIRA)

unread,
Jun 3, 2019, 9:09:02 AM6/3/19
to jenkinsc...@googlegroups.com

You can go to Manage Jenkins and give permission to the script that you modified/Added

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages