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

Operator {{in}} stopped working in Groovy expression in combination filter

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading I had to rewrite all my content filter expressions from using value in array form to array.contains(value) form, otherwise I was getting java.lang.IllegalArgumentException: 573 at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29) exceptions. The in operator works fine in groovy console and groovy post-build steps.

      The relevant backtrace is:

      Caused by: java.lang.IllegalArgumentException: 573
      	at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedBinaryOp(Checker.java:347)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedBinaryOp.callStatic(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:50)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:173)
      	at Script1.run(Script1.groovy:1)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:139)
      	at hudson.matrix.FilterScript.evaluate(FilterScript.java:45)
      	at hudson.matrix.FilterScript.apply(FilterScript.java:85)
      	at hudson.matrix.Combination.evalGroovyExpression(Combination.java:101)
      	at hudson.matrix.Combination.evalGroovyExpression(Combination.java:91)
      	at hudson.matrix.MatrixProject.rebuildConfigurations(MatrixProject.java:638)
      	at hudson.matrix.MatrixProject.submit(MatrixProject.java:887)
      	at hudson.model.Job.doConfigSubmit(Job.java:1188)
      	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:785)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	... 70 more
      

        Attachments

          Issue Links

            Activity

            bulb Jan Hudec created issue -
            bulb Jan Hudec made changes -
            Field Original Value New Value
            Description After upgrading I had to rewrite all my content filter expressions from using {{value in array}} to {{array.contains(value)}}, otherwise I was getting {{java.lang.IllegalArgumentException: 573
            at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29)}} exceptions. The {{in}} operator works fine in groovy console and groovy post-build steps.

            The relevant backtrace is:

            {code}
            Caused by: java.lang.IllegalArgumentException: 573
            at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedBinaryOp(Checker.java:347)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedBinaryOp.callStatic(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:50)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:173)
            at Script1.run(Script1.groovy:1)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:139)
            at hudson.matrix.FilterScript.evaluate(FilterScript.java:45)
            at hudson.matrix.FilterScript.apply(FilterScript.java:85)
            at hudson.matrix.Combination.evalGroovyExpression(Combination.java:101)
            at hudson.matrix.Combination.evalGroovyExpression(Combination.java:91)
            at hudson.matrix.MatrixProject.rebuildConfigurations(MatrixProject.java:638)
            at hudson.matrix.MatrixProject.submit(MatrixProject.java:887)
            at hudson.model.Job.doConfigSubmit(Job.java:1188)
            at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:785)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
            at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
            at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
            at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
            at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
            ... 70 more
            {code}
            After upgrading I had to rewrite all my content filter expressions from using {{value in array}} form to {{array.contains(value)}} form, otherwise I was getting {{java.lang.IllegalArgumentException: 573 at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29)}} exceptions. The {{in}} operator works fine in groovy console and groovy post-build steps.

            The relevant backtrace is:

            {code}
            Caused by: java.lang.IllegalArgumentException: 573
            at org.kohsuke.groovy.sandbox.impl.Ops.binaryOperatorMethods(Ops.java:29)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedBinaryOp(Checker.java:347)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedBinaryOp.callStatic(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:50)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:173)
            at Script1.run(Script1.groovy:1)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:139)
            at hudson.matrix.FilterScript.evaluate(FilterScript.java:45)
            at hudson.matrix.FilterScript.apply(FilterScript.java:85)
            at hudson.matrix.Combination.evalGroovyExpression(Combination.java:101)
            at hudson.matrix.Combination.evalGroovyExpression(Combination.java:91)
            at hudson.matrix.MatrixProject.rebuildConfigurations(MatrixProject.java:638)
            at hudson.matrix.MatrixProject.submit(MatrixProject.java:887)
            at hudson.model.Job.doConfigSubmit(Job.java:1188)
            at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:785)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
            at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
            at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
            at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
            at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
            ... 70 more
            {code}
            danielbeck Daniel Beck made changes -
            Component/s script-security-plugin [ 18520 ]
            mkorvas Matěj Korvas made changes -
            Link This issue is duplicated by JENKINS-28154 [ JENKINS-28154 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 161671 ] JNJira + In-Review [ 196835 ]

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                bulb Jan Hudec
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: