org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace

Jenkins JIRA | mocsharp | 5 months ago
  1. 0

    The following code failed in Jenkins pipeline: {code:java} def build = manager.build def workspace = build.getWorkspace() def listener = manager.listener def environment = build.getEnvironment(listener) final def project = build.getProject() final def gitScm = project.getScm() final GitClient gitClient = gitScm.createClient(listener, environment, build, workspace); {code} Throws the following error: {noformat} org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace 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:11) 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.fixName(FunctionCallBlock.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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:154) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:29) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:29) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:297) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:206) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:204) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at java.util.concurrent.FutureTask.run(Unknown Source) 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(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {noformat}

    Jenkins JIRA | 5 months ago | mocsharp
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace
  2. 0

    [JIRA] (JENKINS-36505) Groovy Postbuild methods cause RejectedAccessException

    Google Groups | 5 months ago | victo...@live.com (JIRA)
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace
  3. 0

    [JIRA] [git-plugin] (JENKINS-28335) Step to run Git commands w/ credentials & tool (was: GitPublisher support)

    Google Groups | 1 year ago | jgl...@cloudbees.com (JIRA)
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [JIRA] [workflow-plugin] (JENKINS-32156) workflow from SCM:

    Google Groups | 12 months ago | rodrigc@FreeBSD.org (JIRA)
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods toBoolean java.lang.String
  6. 0

    Jenkins groovy pipeline - Need sout of command from executing jar file

    Stack Overflow | 9 months ago | Stephen Nichols
    org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method java.lang.UNIXProcess getText

    7 unregistered visitors
    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

      unclassified method org.jenkinsci.plugins.workflow.job.WorkflowRun getWorkspace

      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall()
    2. org.jenkinsci.plugins
      SandboxInterceptor.onMethodCall
      1. org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:113)
      1 frame
    3. org.kohsuke.groovy
      Checker.checkedCall
      1. org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
      2. org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
      2 frames
    4. com.cloudbees.groovy
      SandboxInvoker.methodCall
      1. com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:15)
      1 frame
    5. Unknown
      ___cps.transform___
      1. WorkflowScript.run(WorkflowScript:11)
      2. ___cps.transform___(Native Method)
      2 frames
    6. com.cloudbees.groovy
      FunctionCallBlock$ContinuationImpl.fixName
      1. com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55)
      2. com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
      3. com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:74)
      3 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    8. com.cloudbees.groovy
      Continuable.run0
      1. com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      2. com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      3. com.cloudbees.groovy.cps.Next.step(Next.java:58)
      4. com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
      4 frames
    9. org.jenkinsci.plugins
      CpsVmExecutorService$2.call
      1. org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      2. org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
      3. org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:29)
      4. org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      5. org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:29)
      6. org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
      7. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:297)
      8. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:78)
      9. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:206)
      10. org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:204)
      11. org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
      11 frames
    10. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(Unknown Source)
      1 frame
    11. Hudson :: Remoting Layer
      SingleLaneExecutorService$1.run
      1. hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      1 frame
    12. jenkins.util
      ContextResettingExecutorService$1.run
      1. jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      1 frame
    13. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      2. java.util.concurrent.FutureTask.run(Unknown Source)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      5. java.lang.Thread.run(Unknown Source)
      5 frames