Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42023

UnapprovedUsageException: script not yet approved for use

XMLWordPrintable

      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

            khakhin_tensor Andrey Khakhin
            khakhin_tensor Andrey Khakhin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: