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

No such property: it for class: Script1

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: script-security-plugin
    • Labels:
      None
    • Environment:
      RHEL x86_64, Jenkins 1.642.2, Email Extension Plugin 2.38.2, script-security 1.17
    • Similar Issues:

      Description

      Basically creating a pre-send script for editable email plug-in results in the exception below. Here's the part of the script blowing:

      def artifactNamed(build, name) {
        return build.artifacts.find { it.fileName == name };
      }
      

      Console log:

      Setting up sandbox for pre-send script
      groovy.lang.MissingPropertyException: No such property: it for class: Script1
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454)
      	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onGetProperty(GroovyValueFilter.java:73)
      	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty.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:177)
      	at Script1$_artifactNamed_closure1.doCall(Script1.groovy:2)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker.invoke(BooleanReturningMethodInvoker.java:49)
      	at org.codehaus.groovy.runtime.callsite.BooleanClosureWrapper.call(BooleanClosureWrapper.java:52)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.find(DefaultGroovyMethods.java:2695)
      	at org.codehaus.groovy.runtime.dgm$261.invoke(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.artifactNamed(Script1.groovy:2)
      	at Script1$artifactNamed.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.run(Script1.groovy:5)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:537)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:480)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:364)
      	at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      	at hudson.model.Build$BuildExecution.cleanUp(Build.java:193)
      	at hudson.model.Run.execute(Run.java:1785)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:381)
      
      groovy.lang.MissingPropertyException: No such property: it for class: Script1
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454)
      	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onGetProperty(GroovyValueFilter.java:73)
      	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty.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:177)
      	at Script1$_artifactNamed_closure1.doCall(Script1.groovy:2)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker.invoke(BooleanReturningMethodInvoker.java:49)
      	at org.codehaus.groovy.runtime.callsite.BooleanClosureWrapper.call(BooleanClosureWrapper.java:52)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.find(DefaultGroovyMethods.java:2695)
      	at org.codehaus.groovy.runtime.dgm$261.invoke(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.artifactNamed(Script1.groovy:2)
      	at Script1$artifactNamed.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
      	at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
      	at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.run(Script1.groovy:5)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:537)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:480)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:364)
      	at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      	at hudson.model.Build$BuildExecution.cleanUp(Build.java:193)
      	at hudson.model.Run.execute(Run.java:1785)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:381)
      

        Attachments

          Issue Links

            Activity

            akostadinov akostadinov created issue -
            Hide
            akostadinov akostadinov added a comment - - edited

            Issue seems same as JENKINS-25119 just something missed.

            Update: Just see I'm not using latest plug-in. Update center lags behind. Trying latest one now.
            update 2: same with 1.17

            Show
            akostadinov akostadinov added a comment - - edited Issue seems same as JENKINS-25119 just something missed. Update: Just see I'm not using latest plug-in. Update center lags behind. Trying latest one now. update 2: same with 1.17
            akostadinov akostadinov made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-25119 [ JENKINS-25119 ]
            akostadinov akostadinov made changes -
            Description Running a following script
            {code}
            "30".toInteger();
            {code}
            Results following error:
            {noformat}
            org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method java.lang.String toInteger
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:63)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:111)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:108)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.run(Script1.groovy)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.run(GroovySandbox.java:119)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:160)
            at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:355)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:780)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
            at hudson.model.Build$BuildExecution.post2(Build.java:183)
            at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:705)
            at hudson.model.Run.execute(Run.java:1617)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:237)
            {noformat}

            It looks caused for {{String.toInteger()}} is not provided in JDK and additionally provided by Groovy.
            Basically creating a pre-send script for editable email plug-in results in the exception below. Here's the part of the script blowing:

            {code:java}
            def artifactNamed(build, name) {
              return build.artifacts.find { it.fileName == name };
            }
            {code}


            Console log:
            {code:java}
            Setting up sandbox for pre-send script
            groovy.lang.MissingPropertyException: No such property: it for class: Script1
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onGetProperty(GroovyValueFilter.java:73)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty.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:177)
            at Script1$_artifactNamed_closure1.doCall(Script1.groovy:2)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
            at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
            at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker.invoke(BooleanReturningMethodInvoker.java:49)
            at org.codehaus.groovy.runtime.callsite.BooleanClosureWrapper.call(BooleanClosureWrapper.java:52)
            at org.codehaus.groovy.runtime.DefaultGroovyMethods.find(DefaultGroovyMethods.java:2695)
            at org.codehaus.groovy.runtime.dgm$261.invoke(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.artifactNamed(Script1.groovy:2)
            at Script1$artifactNamed.call(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.run(Script1.groovy:5)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
            at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:537)
            at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:480)
            at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:364)
            at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350)
            at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
            at hudson.model.Build$BuildExecution.cleanUp(Build.java:193)
            at hudson.model.Run.execute(Run.java:1785)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:381)

            groovy.lang.MissingPropertyException: No such property: it for class: Script1
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
            at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onGetProperty(GroovyValueFilter.java:73)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty.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:177)
            at Script1$_artifactNamed_closure1.doCall(Script1.groovy:2)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
            at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
            at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.codehaus.groovy.runtime.callsite.BooleanReturningMethodInvoker.invoke(BooleanReturningMethodInvoker.java:49)
            at org.codehaus.groovy.runtime.callsite.BooleanClosureWrapper.call(BooleanClosureWrapper.java:52)
            at org.codehaus.groovy.runtime.DefaultGroovyMethods.find(DefaultGroovyMethods.java:2695)
            at org.codehaus.groovy.runtime.dgm$261.invoke(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.artifactNamed(Script1.groovy:2)
            at Script1$artifactNamed.call(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
            at org.kohsuke.groovy.sandbox.GroovyValueFilter.onMethodCall(GroovyValueFilter.java:58)
            at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
            at org.kohsuke.groovy.sandbox.impl.Checker$checkedCall.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 Script1.run(Script1.groovy:5)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
            at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:537)
            at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:480)
            at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:364)
            at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:350)
            at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
            at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
            at hudson.model.Build$BuildExecution.cleanUp(Build.java:193)
            at hudson.model.Run.execute(Run.java:1785)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:381)
            {code}
            akostadinov akostadinov made changes -
            Environment Windows 8 64bit, Jenkins 1.509.4, groovy-postbuild 2.0, script-security 1.6 RHEL x86_64, Jenkins 1.642.2, Email Extension Plugin 2.38.2, script-security 1.15
            akostadinov akostadinov made changes -
            Environment RHEL x86_64, Jenkins 1.642.2, Email Extension Plugin 2.38.2, script-security 1.15 RHEL x86_64, Jenkins 1.642.2, Email Extension Plugin 2.38.2, script-security 1.17
            Hide
            akostadinov akostadinov added a comment -

            My immediate issue is resolved by upgrading to email-ext-plugin from master (1.42.SNAPSHOT) where support for script sandboxing is dropped. But I guess it's still good to have this issue fixed in the sandbox plug-in.

            Show
            akostadinov akostadinov added a comment - My immediate issue is resolved by upgrading to email-ext-plugin from master (1.42.SNAPSHOT) where support for script sandboxing is dropped. But I guess it's still good to have this issue fixed in the sandbox plug-in.
            jglick Jesse Glick made changes -
            Summary CLONE - Sandbox cannot handle methods Groovy provides additionally No such property: it for class: Script1
            Hide
            jglick Jesse Glick added a comment -

            Probably suffices to use

            build.artifacts.find { artifact -> artifact.fileName == name }
            
            Show
            jglick Jesse Glick added a comment - Probably suffices to use build.artifacts.find { artifact -> artifact.fileName == name }
            jglick Jesse Glick made changes -
            Remote Link This issue links to "groovy-sandbox #23 (Web Link)" [ 14285 ]
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35390 [ 171183 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 169390 ] JNJira + In-Review [ 183479 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking SECURITY-123 [ SECURITY-123 ]
            Hide
            noelgeorgi Noel Georgi added a comment -

            I am also facing the same problem
            groovy.lang.MissingPropertyException: No such property: it for class: groovy.lang.Binding
            at groovy.lang.Binding.getVariable(Binding.java:63)

            Show
            noelgeorgi Noel Georgi added a comment - I am also facing the same problem groovy.lang.MissingPropertyException: No such property: it for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63)
            Hide
            noelgeorgi Noel Georgi added a comment -

            I am also having the same issue

            groovy.lang.MissingPropertyException: No such property: it for class: groovy.lang.Binding
            at groovy.lang.Binding.getVariable(Binding.java:63)

             

            I hope this gets resolved soon as it been too long.

            Show
            noelgeorgi Noel Georgi added a comment - I am also having the same issue groovy.lang.MissingPropertyException: No such property: it for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63)   I hope this gets resolved soon as it been too long.
            Hide
            jglick Jesse Glick added a comment -

            Noel Georgi the workaround is trivial, see above.

            Show
            jglick Jesse Glick added a comment - Noel Georgi the workaround is trivial, see above.
            Hide
            noelgeorgi Noel Georgi added a comment -

            Yeh, i figured it out, did something as above. thanks. Jesse Glick but shouldn't this issue be closed

            Show
            noelgeorgi Noel Georgi added a comment - Yeh, i figured it out, did something as above. thanks. Jesse Glick but shouldn't this issue be closed
            Hide
            jglick Jesse Glick added a comment -

            No, I would like to fix it someday.

            Show
            jglick Jesse Glick added a comment - No, I would like to fix it someday.
            Hide
            geopc Geo PC added a comment -

            We are also getting the same error when we use email ext plugin with ${SCRIPT, template="SquishSummary.groovy"} as in Pre-send script

            groovy.lang.MissingPropertyException: No such property: it for class: Script1
            {{ at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)}}
            {{ at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)}}
            {{ ......}}

            See the relevant part of SquishSummary.groovy

            List resultFiles = []
            {{ def summaries = new XmlSlurper().parse( summaryFile )}}
            {{ summaries.summary.each {}}
            {{ resultFiles.push( new File( squishResultsPath, it.xmlFileName.text() ) )}}
            {{ }}}

            Please let me know what we need to change for this.

            We tried as resultFiles.push( new File( squishResultsPath, { File -> .FilexmlFileName.text() } ) )

            But its not working. Can you please help?

            Show
            geopc Geo PC added a comment - We are also getting the same error when we use email ext plugin with ${SCRIPT, template="SquishSummary.groovy"} as in Pre-send script groovy.lang.MissingPropertyException: No such property: it for class: Script1 {{ at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)}} {{ at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)}} {{ ......}} See the relevant part of SquishSummary.groovy List resultFiles = [] {{ def summaries = new XmlSlurper().parse( summaryFile )}} {{ summaries.summary.each {}} {{ resultFiles.push( new File( squishResultsPath, it.xmlFileName.text() ) )}} {{ }}} Please let me know what we need to change for this. We tried as resultFiles.push( new File( squishResultsPath, { File -> .FilexmlFileName.text() } ) ) But its not working. Can you please help?
            Hide
            jglick Jesse Glick added a comment -

            Please use the jenkinsci-users list for assistance, not the bug tracker.

            Show
            jglick Jesse Glick added a comment - Please use the jenkinsci-users list for assistance, not the bug tracker.
            Hide
            abayer Andrew Bayer added a comment -

            Works in workflow-cps 2.39+.

            Show
            abayer Andrew Bayer added a comment - Works in workflow-cps 2.39+.
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            jglick Jesse Glick added a comment -

            Did you check in non-Pipeline scripts too? See https://github.com/jenkinsci/groovy-sandbox/pull/34 for a proposed fix.

            Show
            jglick Jesse Glick added a comment - Did you check in non-Pipeline scripts too? See https://github.com/jenkinsci/groovy-sandbox/pull/34  for a proposed fix.
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Assignee Jesse Glick [ jglick ]
            Hide
            jglick Jesse Glick added a comment -

            also this

            Show
            jglick Jesse Glick added a comment - also this
            Hide
            abayer Andrew Bayer added a comment -

            Good call. New PR based on that one going up now.

            Show
            abayer Andrew Bayer added a comment - Good call. New PR based on that one going up now.
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Reopened [ 4 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "groovy-sandbox PR #38 (Web Link)" [ 17442 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "script-security PR #140 (Web Link)" [ 17443 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pom.xml
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
            http://jenkins-ci.org/commit/script-security-plugin/88607f7a4be280e65a7cd79c10c2d38474d437db
            Log:
            JENKINS-33468 Enable closure implicit parameter test

            Downstream of https://github.com/jenkinsci/groovy-sandbox/pull/38

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/88607f7a4be280e65a7cd79c10c2d38474d437db Log: JENKINS-33468 Enable closure implicit parameter test Downstream of https://github.com/jenkinsci/groovy-sandbox/pull/38
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
            http://jenkins-ci.org/commit/script-security-plugin/348f1d6c741bd10ec25b45efab027592f07d9351
            Log:
            Merge pull request #140 from abayer/jenkins-33468

            JENKINS-33468 Enable closure implicit parameter test

            Compare: https://github.com/jenkinsci/script-security-plugin/compare/7a81a076e46e...348f1d6c741b

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/348f1d6c741bd10ec25b45efab027592f07d9351 Log: Merge pull request #140 from abayer/jenkins-33468 JENKINS-33468 Enable closure implicit parameter test Compare: https://github.com/jenkinsci/script-security-plugin/compare/7a81a076e46e...348f1d6c741b
            pwiseman Peter Wiseman made changes -
            Link This issue is duplicated by JENKINS-46192 [ JENKINS-46192 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                akostadinov akostadinov
              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: