Skip to content
This repository was archived by the owner on Jun 12, 2020. It is now read-only.
This repository was archived by the owner on Jun 12, 2020. It is now read-only.

Getting an UnapprovedUsageException message in our Jenkins build pipelines #5

@binbash12

Description

@binbash12

We're getting the following message in our build pipelines in Jenkins from the Splunk for Jenkins plugin. We're running Splunk Plugin and Splunk Plugin Extension version 1.6.4, we configure our plugins as code, and the message just started appearing recently. The Jenkins version we experienced this on is 2.107.2.

org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval.using(ScriptApproval.java:466)
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval$using$0.call(Unknown Source)
at com.splunk.splunkjenkins.UserActionDSL.perform(UserActionDSL.groovy:41)
at com.splunk.splunkjenkins.listeners.LoggingRunListener.onCompleted(LoggingRunListener.java:85)
at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:730)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$1200(WorkflowRun.java:142)
at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1065)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1413)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:412)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

The stack trace points to the exception being thrown from here:

ScriptApproval.get().using(scriptText, GroovyLanguage.get());

This is the script that we're running:

"""//send job metadata and junit reports with page size set to 50 (each event contains max 50 test cases)
splunkins.sendTestReport(50)
//send coverage, each event contains max 50 class metrics
splunkins.sendCoverageReport(50)
//send all logs from workspace to splunk, with each file size limits to 10MB
splunkins.archive("**/*.log", null, false, "10MB")

//end"""

It's not showing up in the approve scripts menu, so we aren't sure what to whitelist.

Please let us know if you need any additional information.

Best regards,
Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions