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

I am unable to view the log.html or report.html file because of javascript error messages

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • robot-plugin
    • None
    • I am using Jenkins ver. 2.222.1 and the latest version of robot-plugin. On a Windows x64 Server

      I am unable to view the log.html or report.html file because of javascript error messages.

      I am using Google Chrome to view the Jenkins Dashboard.
      see atached screen shots

          [JENKINS-62027] I am unable to view the log.html or report.html file because of javascript error messages

          Use this JVM option:

          -Dhudson.model.DirectoryBrowserSupport.CSP="sandbox allow-scripts allow-same-origin; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;"
          

          Morgan Christiansson added a comment - Use this JVM option: -Dhudson.model.DirectoryBrowserSupport.CSP= "sandbox allow-scripts allow-same-origin; default -src 'none' ; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;"

          Aleksi Simell added a comment -

          mgaert Is this still an issue? Did the above solution help? You can also modify that from your Jenkins instance's script console by using System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox allow-scripts; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;").

          By default, Jenkins is very restrictive on permissions for external reports, so those permissions need to be relaxed, or you need a resource root URL for your Jenkins instance to display reports.

          Aleksi Simell added a comment - mgaert Is this still an issue? Did the above solution help? You can also modify that from your Jenkins instance's script console by using System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox allow-scripts; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;") . By default, Jenkins is very restrictive on permissions for external reports, so those permissions need to be relaxed, or you need a resource root URL for your Jenkins instance to display reports.

          Pritam added a comment -

          Hi aleksisimell , mgaert 

          Do we have any permanent solution for this yet?

          My current jenkins version : 2.346.2

          Pritam added a comment - Hi aleksisimell , mgaert   Do we have any permanent solution for this yet? My current jenkins version : 2.346.2

          Aleksi Simell added a comment -

          samfishherv3, no. As mentioned in the plugin documentation, enabling this from the plugin by default is a security issue. You need to allow Jenkins separately to show external HTML files. You can add these options for Jenkins startup, so you don't need to re-enter them every time your Jenkins is restarted, but this is not doable nor will be doable by the plugin.

          Aleksi Simell added a comment - samfishherv3 , no. As mentioned in the plugin documentation , enabling this from the plugin by default is a security issue. You need to allow Jenkins separately to show external HTML files. You can add these options for Jenkins startup, so you don't need to re-enter them every time your Jenkins is restarted, but this is not doable nor will be doable by the plugin.

            aleksisimell Aleksi Simell
            mgaert Michael Gärtner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: