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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • Jenkins 2.32.1
      All plugins up to date today 30.01.2017 eg. Pipeline 2.4

      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
      

            wolfs Stefan Wolf
            jansenm Michael jansen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: