Report Display Issues
Symptom
When you view a task report, it may display incorrectly, as shown in Figure 1.
Possible Causes
The report may display incorrectly due to the Content Security Policy (CSP).
Troubleshooting Procedure
- Temporary solution (effective until the next restart)
- Choose Manage Jenkins > Script Console.
Figure 2 Manual temporary modification (1)
- On the Script Console page that is displayed, enter the following command in the text box and click Run.
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' ; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' blob: data:; ")Figure 3 Manual temporary modification (2)
- Choose Manage Jenkins > Script Console.
- Permanent solution (settings remain effective after a restart)
- Set Environment="JAVA_OPTS=-Djava.awt.headless=true" in the /usr/lib/systemd/system/jenkins.service file.
sed -i 's/Environment="JAVA_OPTS=-Djava.awt.headless=true"/Environment="JAVA_OPTS=-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\\"default-src \x27none\x27; script-src \x27self\x27 \x27unsafe-inline\x27 \x27unsafe-eval\x27; style-src \x27self\x27 \x27unsafe-inline\x27; img-src \x27self\x27 \x27unsafe-inline\x27 blob: data:;\\""/g' /usr/lib/systemd/system/jenkins.service
- Reload the systemd manager configuration.
systemctl daemon-reload
- Restart the Jenkins service.
systemctl restart jenkins.service
- Set Environment="JAVA_OPTS=-Djava.awt.headless=true" in the /usr/lib/systemd/system/jenkins.service file.
