org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object

Jenkins JIRA | Andres Rodriguez | 7 months ago
  1. 0

    When building with {{-Djenkins.version=2.0 -Djava.level=7}} the following errors appears: {noformat} keywordsAndOperators(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest) Time elapsed: 0.273 sec <<< ERROR! org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate(SandboxInterceptorTest.java:582) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.keywordsAndOperators(SandboxInterceptorTest.java:542) ambiguousOverloads(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest) Time elapsed: 0.03 sec <<< ERROR! groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest$Ambiguity#m. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class java.lang.String] [class java.net.URL] at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate(SandboxInterceptorTest.java:582) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.ambiguousOverloads(SandboxInterceptorTest.java:497) {noformat} They seem related to the upgrade from Groovy 1.8.9 to 2.4.6

    Jenkins JIRA | 7 months ago | Andres Rodriguez
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object
  2. 0

    [JIRA] [script-security-plugin] (JENKINS-34466) Fix PCT against 2.0

    Google Groups | 7 months ago | andr...@cloudbees.com (JIRA)
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object
  3. 0

    When building with {{-Djenkins.version=2.0 -Djava.level=7}} the following errors appears: {noformat} keywordsAndOperators(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest) Time elapsed: 0.273 sec <<< ERROR! org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate(SandboxInterceptorTest.java:582) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.keywordsAndOperators(SandboxInterceptorTest.java:542) ambiguousOverloads(org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest) Time elapsed: 0.03 sec <<< ERROR! groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest$Ambiguity#m. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class java.lang.String] [class java.net.URL] at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate(SandboxInterceptorTest.java:582) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.ambiguousOverloads(SandboxInterceptorTest.java:497) {noformat} They seem related to the upgrade from Groovy 1.8.9 to 2.4.6

    Jenkins JIRA | 7 months ago | Andres Rodriguez
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [JIRA] [pipeline-view-plugin] (JENKINS-35681) Scripts not permitted to use staticMethod DefaultGroovyMethods each java.util.List Closure

    Google Groups | 6 months ago | kevin.br...@gmail.com (JIRA)
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods each java.util.List groovy.lang.Closure
  6. 0

    Within a Pipeline script, the `each` method can not be used on a List. e.g. {code:java} ['clang', 'gcc'].each { compiler -> echo "compiler = ${compiler}" } {code} Error: {code} org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods each java.util.List groovy.lang.Closure at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectStaticMethod(StaticWhitelist.java:174) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:95) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:15) at WorkflowScript.run(WorkflowScript:68) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:40) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:276) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:185) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) ... {code} I apologize as I'm sure the component is incorrect.

    Jenkins JIRA | 6 months ago | Kevin Brightwell
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods each java.util.List groovy.lang.Closure

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException

      Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods leftShift java.util.List java.lang.Object

      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate()
    2. org.jenkinsci.plugins
      SandboxInterceptorTest.keywordsAndOperators
      1. org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.assertEvaluate(SandboxInterceptorTest.java:582)
      2. org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptorTest.keywordsAndOperators(SandboxInterceptorTest.java:542)
      2 frames