manager.createSummary().appendText() fails in sandbox

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The following Pipeline Skript fails in the sandbox

      node {
          stage("this triggers bug without script approval") {
              manager.createSummary("warning.gif").appendText('test')
          }
      
          stage("this triggers bug with script approval") {
             manager.createSummary("warning.gif").appendText("<h1>You have been warned!</h1>", false, false, false, "red")
          }
      
      }
      

      With the following error.

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildSummaryAction appendText java.lang.String
      	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)
      

      Additional Notes

      Now after writing the bug i see that when i copy+paste the documentation example it fails but i get a pending script approval.

      I guess those methods should be available in the sandbox by default?

      method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager createSummary java.lang.String
      method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildSummaryAction appendText java.lang.String boolean boolean boolean java.lang.String
      

            Assignee:
            Stefan Wolf
            Reporter:
            Michael jansen
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: