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

Unable to view a pdf file from jenkins workspace

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      Is this also due to restrictive Content-Security-Policy? If yes, do we have a workaround?

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

          Try to provide actual details about what the problem is you're experiencing. "Unable" covers a wide range.

          Show
          danielbeck Daniel Beck added a comment - Try to provide actual details about what the problem is you're experiencing. "Unable" covers a wide range.
          Hide
          hkhan17 Hussain Khan added a comment -

          Basically, I cannot open a pdf file on chrome browser from jenkins workspace. If I try opening I get a blank page as you can see in the attached snapshot.

          It works fine if I open it outside the workspace though.

           

          Let me know if you need more clarification!

          Show
          hkhan17 Hussain Khan added a comment - Basically, I cannot open a pdf file on chrome browser from jenkins workspace.  If I try opening I get a blank page as you can see in the attached snapshot. It works fine if I open it outside the workspace though.   Let me know if you need more clarification!
          Hide
          hkhan17 Hussain Khan added a comment -

          Basically, I cannot open a pdf file on chrome browser from jenkins workspace. If I try opening the file I get a blank page as you can see in the attached snapshot.

          It works fine if I open it outside the workspace though.

           Let me know if you need more clarification!

          Show
          hkhan17 Hussain Khan added a comment - Basically, I cannot open a  pdf file  on chrome browser from  jenkins workspace.  If I try opening the file I get a blank page as you can see in the attached snapshot. It works fine if I open it outside the workspace though.  Let me know if you need more clarification!
          Hide
          danielbeck Daniel Beck added a comment -

          If it's a CSP problem, your browser's debug/network console should tell you.

          Note that Jenkins 2.200 has an alternative to CSP for user-generated content (that is not simply disabling it)

          Show
          danielbeck Daniel Beck added a comment - If it's a CSP problem, your browser's debug/network console should tell you. Note that Jenkins 2.200 has an alternative to CSP for user-generated content (that is not simply disabling it)
          Hide
          hkhan17 Hussain Khan added a comment -

          Thanks Daniel!

          I checked the browser's console and it shows the following error:

          "Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-C7vpsE1KLI7RuUgCprJTQZin6dWK+ccynbOx+OqjVow='), or a nonce ('nonce-...') is required to enable inline execution."

          So it does seems to be a CSP problem. When you said alternative you meant that we can relax the rule set right with the help fo this doc - https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy

          Show
          hkhan17 Hussain Khan added a comment - Thanks Daniel! I checked the browser's console and it shows the following error: "Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-C7vpsE1KLI7RuUgCprJTQZin6dWK+ccynbOx+OqjVow='), or a nonce ('nonce-...') is required to enable inline execution." So it does seems to be a CSP problem. When you said alternative you meant that we can relax the rule set right with the help fo this doc -  https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy
          Hide
          danielbeck Daniel Beck added a comment -

          When you said alternative you meant that we can relax the rule set right with the help fo this doc

          No, but if you actually read today's version of that wiki page it'll point out the alternative

          Show
          danielbeck Daniel Beck added a comment - When you said alternative you meant that we can relax the rule set right with the help fo this doc No, but if you actually read today's version of that wiki page it'll point out the alternative

            People

            • Assignee:
              Unassigned
              Reporter:
              hkhan17 Hussain Khan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: