[JIRA] [script-security-plugin] (JENKINS-34592) unclassified method java.lang.String[] getAt java.lang.Integer

38 views
Skip to first unread message

cybermans@gmail.com (JIRA)

unread,
May 4, 2016, 5:17:01 AM5/4/16
to jenkinsc...@googlegroups.com
mans matulewicz created an issue
 
Jenkins / Bug JENKINS-34592
unclassified method java.lang.String[] getAt java.lang.Integer
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: script-security-plugin
Created: 2016/May/04 9:16 AM
Environment: Jenkins 1.652 script-security-plugin 1.19
Priority: Minor Minor
Reporter: mans matulewicz

Jenkinsfile:
node ('master') {
checkout scm

def PLATFORMS = readFile('.platform').trim()
env.PLATFORMS = PLATFORMS
def eppo = []
def stepsForParallel = [:]
eppo = PLATFORMS.split(",")

for (int i = 0; i < eppo.size(); i++)

{ def s = eppo.getAt(i) println ("platform: $s") }

}

Trace:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method java.lang.String[] getAt java.lang.Integer
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:113)
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:17)
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.GeneratedMethodAccessor204.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:33)
at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:22)
at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
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:277)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

cybermans@gmail.com (JIRA)

unread,
May 4, 2016, 6:58:01 AM5/4/16
to jenkinsc...@googlegroups.com
mans matulewicz updated an issue
Change By: mans matulewicz
The signature doesnt get listed on the approve page

Jenkinsfile:
node ('master') {
    checkout scm

    def PLATFORMS = readFile('.platform').trim()
    env.PLATFORMS = PLATFORMS
    def eppo = []
    def stepsForParallel = [:]
    eppo = PLATFORMS.split(",")

    for (int i = 0; i < eppo.size(); i++) {
        def s = eppo.getAt(i)
        println ("platform: $s")
        
        
    }

}

Trace:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method java.lang.String[] getAt java.lang.Integer
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:113)
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:17)
at ___cps.transform___(Native Method)

andrew.bayer@gmail.com (JIRA)

unread,
May 27, 2016, 3:06:03 PM5/27/16
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-34592
 
Re: unclassified method java.lang.String[] getAt java.lang.Integer

Jesse Glick - I can't figure out how to add this to the generic whitelist - I get

{method java.lang.String[] getAt java.lang.Integer does not exist (or is an override)}

and when I try

{int}

or

{java.lang.Object[]}

, same thing. Any ideas on arrays?

sshkolni@adobe.com (JIRA)

unread,
Nov 28, 2016, 8:48:02 PM11/28/16
to jenkinsc...@googlegroups.com

Hi Andrew,
I am running into similar problem myself.
I was to add all other methods into XML file scriptApproval.xml. But, when I add "unclassified method" to whitelist in xml file, it starts to ignore the rest of the whitelist... Have you figured out how to add it?
Thanks!

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

jglick@cloudbees.com (JIRA)

unread,
Dec 5, 2016, 5:28:02 PM12/5/16
to jenkinsc...@googlegroups.com

Andrew Bayer because this is in DefaultGroovyMethods, perhaps. TBD.

Sasha Shkolnik do not do that.

gimpel@ferrari-electronic.de (JIRA)

unread,
Dec 22, 2016, 2:59:02 PM12/22/16
to jenkinsc...@googlegroups.com

Same problem here. The Jenkinsfile runs fine as a pipeline project, but not as a multi branch pipeline. It is not possible to approve the MyClass[] getAt java.lang.Integer method, because it is not listed on the approve page. Any suggestions how to fix or work-around that blocking problem existing for 7 months?

gimpel@ferrari-electronic.de (JIRA)

unread,
Dec 22, 2016, 3:43:01 PM12/22/16
to jenkinsc...@googlegroups.com

Replacing a.getAt(index) by a[index] works for me.

knurek.j@gmail.com (JIRA)

unread,
Jan 9, 2017, 5:44:02 AM1/9/17
to jenkinsc...@googlegroups.com
J Knurek commented on Bug JENKINS-34592

I also experienced this bug, and the work-around suggested by Thomas fixed it:

Replacing a.getAt(index) by a[index]

Reply all
Reply to author
Forward
0 new messages