如何修复 Jenkins HTML 报告 "checksum mismatch"?

How do I fix a Jenkins HTML report "checksum mismatch"?

我在 Linux Ubuntu 上得到了一台全新的 Jenkins 机器 运行。我使用 HTML Publisher Plugin 来发布我的 html 报告。我也使用 Jsystem 来调用测试场景。

在测试结束时,当打开 latest html 报告时 project main page 我得到这个错误:

Checksum mismatch

The checksum of the current wrapper file (0dd0c5ec07dff1d7179f03b5deb290e96ac68f8c) does not match the recorded checksum (090f21ac5f8c4b0eed9e789145a2fe2a6134c900). This indicates a possible security issue, therefore Jenkins will not serve this file. You can access the archived HTML files here.

我已经检查了文件和权限是否存在。如果我从工作页面打开报告,那么一切正常。

更新:

当我从工作页面打开报告时,我没有 CSS 并且有很多错误。 看起来像是一个安全问题。

更新 2:

CSS 和 Javascript 回来了,Jenkins 更新了他们的 Content Security Policy。将 args 添加到 Jenkins 启动脚本。第一期还在。 :(

对我有用:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

这是该版本 HTML 发布者插件中的一个错误。如果您的工作中有多个报告,则会发生该错误,标记发布选项:'Keep past HTML reports',然后单击关于第二份报告。

https://issues.jenkins-ci.org/browse/JENKINS-32281

https://jenkins.ci.cloudbees.com/job/plugins/job/htmlpublisher-plugin/61/ 中的解决方案。

解决方案作为插件的 1.11 版本发布。