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

sleep step inside node throws RejectedAccessException

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Jenkins ver. 1.609.14.1 (CloudBees Jenkins Enterprise 15.05)

      http://jenkins-aws.beesshop.org/job/game-of-life-multi-branch/branch/amazon-ecs-pipeline/3/console

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (org.jenkinsci.plugins.workflow.cps.CpsClosure2 sleep java.lang.Integer)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:155)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:77)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:68)
      	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:27)
      	at Unknown.Unknown(Unknown)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
      	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.GeneratedMethodAccessor312.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
      	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:106)
      	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:274)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:74)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:183)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:181)
      	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)
      	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:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Finished: FAILURE
      

      https://github.com/cyrille-leclerc/game-of-life/blob/53f279a48de561e3ff95beb10d433c3875a2ad07/Jenkinsfile

      docker.withRegistry('', 'dockerhub-credentials-cleclerc') {
      
          checkout scm
          def mavenSettingsFile = "${pwd()}/.m2/settings.xml"
          writeFile file: mavenSettingsFile, text: "<settings><localRepository>${pwd()}/.m2/repo</localRepository></settings>"
          echo "1. PWD: ${pwd()}"
      
          stage 'Build Web App'
          docker.image('cloudbees/java-build-tools:0.0.5').inside {
              echo "2. PWD: ${pwd()}"
              sh "mvn -B -V -s ${mavenSettingsFile} clean package"
          }
      
          // build docker image 'cleclerc/game-of-life' and push it to docker hub
          stage 'Build & Push Docker Image'
      
          echo 'Build docker image cleclerc/game-of-life...'
          def gameOfLifeImage = docker.build('cleclerc/game-of-life', 'gameoflife-web')
      
          echo 'Push docker image cleclerc/game-of-life to Docker Hub...'
          gameOfLifeImage.push()
      
          stage 'Redeploy ECS Service'
          wrap([$class: 'AmazonAwsCliBuildWrapper', credentialsId: 'aws-cleclerc-admin', defaultRegion: 'us-east-1']) {
              // TODO THESE ARE PROBABLY NOT THE BEST ECS CALLS
              sh "aws ecs update-service --service game-of-life --desired-count 0"
              sleep 60
              sh "aws ecs update-service --service game-of-life --desired-count 1"
              sleep 20
          }
      
          stage 'Web Browser tests'
          mail body: "Start web browser tests on http://gameoflife-ecs.beesshop.org/ ?",subject: "Start web browser tests on http://gameoflife-ecs.beesshop.org/ ?", to: 'cleclerc@cloudbees.com'
      
          input "Start web browser tests on http://gameoflife-ecs.beesshop.org/ ?"
      
          // web browser tests are fragile, test up to 3 times
          retry(3) {
              docker.image('cloudbees/java-build-tools:0.0.5').inside {
                  echo "3. PWD: ${pwd()}"
                  sh """
                     curl http://gameoflife-ecs.beesshop.org/
                     cd gameoflife-acceptance-tests
                     mvn -B -V -s -s ${mavenSettingsFile} verify -Dwebdriver.driver=remote -Dwebdriver.base.url=http://gameoflife-ecs.beesshop.org/
                  """
              }
          }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
            http://jenkins-ci.org/commit/script-security-plugin/e6ccfc979b959490f8db21166a5bf2c69e566e43
            Log:
            JENKINS-31701 Misclassification of a method taking long and being passed an int.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/e6ccfc979b959490f8db21166a5bf2c69e566e43 Log: JENKINS-31701 Misclassification of a method taking long and being passed an int.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java
            src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
            http://jenkins-ci.org/commit/script-security-plugin/af0b1ae64f365f015836f47d2b642d085cd6e069
            Log:
            Merge pull request #33 from jglick/RejectedAccessException-JENKINS-31701

            JENKINS-31701 Misclassification of a method taking long and being passed an int

            Compare: https://github.com/jenkinsci/script-security-plugin/compare/bad55dc4c719...af0b1ae64f36

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelector.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/GroovyCallSiteSelectorTest.java src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java http://jenkins-ci.org/commit/script-security-plugin/af0b1ae64f365f015836f47d2b642d085cd6e069 Log: Merge pull request #33 from jglick/RejectedAccessException- JENKINS-31701 JENKINS-31701 Misclassification of a method taking long and being passed an int Compare: https://github.com/jenkinsci/script-security-plugin/compare/bad55dc4c719...af0b1ae64f36
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java
            pom.xml
            http://jenkins-ci.org/commit/workflow-plugin/f00baa8aeb76d9ca1125351c3c1a537b187b7e46
            Log:
            JENKINS-31701 Verifying fix in reported context.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java pom.xml http://jenkins-ci.org/commit/workflow-plugin/f00baa8aeb76d9ca1125351c3c1a537b187b7e46 Log: JENKINS-31701 Verifying fix in reported context.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java
            pom.xml
            http://jenkins-ci.org/commit/workflow-plugin/3aaaabe37169fdcee1ce5b1d513ebd3c392d9982
            Log:
            Merge pull request #257 from jglick/RejectedAccessException-JENKINS-31701

            JENKINS-31701 Verifying fix in reported context

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/527cbb86ddfb...3aaaabe37169

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java pom.xml http://jenkins-ci.org/commit/workflow-plugin/3aaaabe37169fdcee1ce5b1d513ebd3c392d9982 Log: Merge pull request #257 from jglick/RejectedAccessException- JENKINS-31701 JENKINS-31701 Verifying fix in reported context Compare: https://github.com/jenkinsci/workflow-plugin/compare/527cbb86ddfb...3aaaabe37169
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/593e66ebf5d973d42fac76b69da7c3528c292df7
            Log:
            JENKINS-31701 Verifying fix in reported context.
            Originally-Committed-As: f00baa8aeb76d9ca1125351c3c1a537b187b7e46

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/SleepStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/593e66ebf5d973d42fac76b69da7c3528c292df7 Log: JENKINS-31701 Verifying fix in reported context. Originally-Committed-As: f00baa8aeb76d9ca1125351c3c1a537b187b7e46

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                cleclerc Cyrille Le Clerc
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: