-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins ver. 1.643,
HTML Publisher plugin 1.10
-
Powered by SuggestiMate
I publish several HTML reports after a build and after sorting out the Content Security Policy updates, one error remains.
Checksum mismatch
The checksum of the current wrapper file (5ea0d2ed1f4d0710e3ceaa8d2c3d9b35a3a13475) does not match the recorded checksum (6db1021567d9b39bdcd2b32a86e1dad589f620dd). This indicates a possible security issue, therefore Jenkins will not serve this file. You can access the archived HTML files here.
I don't know what this means or how to address it and I can't find any information in the HTML publisher plugin docs. Each report is configured like this one:
The problem only occurs when I click on the project-level report link, for example:
https://example.com/job/ExampleProject/Tests/
If I click the build-specific report, it displays fine, for example:
https://example.com/job/ExampleProject/101/Tests/
The same problem goes unanswered on Stack Overflow: http://stackoverflow.com/questions/34419223/jenkins-html-publisher-plugin-checksum-mismatch
- report.PNG
- 10 kB
[JENKINS-32281] HTML report shows "Checksum mismatch"
I found the source code that produces this message, but don't know how I get into this state to try to fix it
Ugh. This shouldn't happen…
Could you provide the wrapper HTML file archived in Jenkins next to the HTML report, as well as the build.xml file?
What happens starting in HTML Publisher 1.10 is that the generated HTML Publisher wrapper file gets its checksum recorded during creation, and that checksum is stored in the build.xml.
Before serving the file afterwards, if the checksum in the build.xml is present (for backward compatibility), it gets recalculated from the archived file. If there's a mismatch, the file isn't served.
Is the wrapper file something I'd get off the filesystem of the Jenkins server (and not through the web interface)?
I'm uncomfortable uploading the entire build or config file (there's some sensitive URLs, etc in these files), so let me snip the relevant parts. Let me know if you need more.
build.xml
<htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction plugin="htmlpublisher@1.10"> <actualHtmlPublisherTarget> <reportName>Tests</reportName> <reportDir>bin/reports/unittest</reportDir> <reportFiles>index.html</reportFiles> <alwaysLinkToLastBuild>true</alwaysLinkToLastBuild> <keepAll>true</keepAll> <allowMissing>true</allowMissing> </actualHtmlPublisherTarget> <outer-class reference="../actualHtmlPublisherTarget"/> <wrapperChecksum>5ea0d2ed1f4d0710e3ceaa8d2c3d9b35a3a13475</wrapperChecksum> <outer-class defined-in="htmlpublisher.HtmlPublisherTarget$HTMLBuildAction" reference="../actualHtmlPublisherTarget"/> </htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction>
config.xml
<htmlpublisher.HtmlPublisher plugin="htmlpublisher@1.10"> <reportTargets> <htmlpublisher.HtmlPublisherTarget> <reportName>Tests</reportName> <reportDir>bin/reports/unittest</reportDir> <reportFiles>index.html</reportFiles> <alwaysLinkToLastBuild>true</alwaysLinkToLastBuild> <keepAll>true</keepAll> <allowMissing>true</allowMissing> </htmlpublisher.HtmlPublisherTarget> </reportTargets> </htmlpublisher.HtmlPublisher>
I am also seeing this issue after I have updated to Jenkins 1.645 and updating HTML Publisher Plugin from 1.06 to 1.10. Please let me know if more details are needed.
build.xml
<htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction plugin="htmlpublisher@1.10">
<actualHtmlPublisherTarget>
<reportName>WUG TA HTML Report</reportName>
<reportDir>nm\QA_Automation\v17.0\WUGEmailableReport</reportDir>
<reportFiles>Results.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</actualHtmlPublisherTarget>
<outer-class reference="../actualHtmlPublisherTarget"/>
<wrapperChecksum>b804be0e5318971e835d34f9aa44b2f0962f83bc</wrapperChecksum>
<outer-class defined-in="htmlpublisher.HtmlPublisherTarget$HTMLBuildAction" reference="../actualHtmlPublisherTarget"/>
</htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction>
<htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction plugin="htmlpublisher@1.10">
<actualHtmlPublisherTarget>
<reportName>TestNG XSLT Report</reportName>
<reportDir>nm\QA_Automation\v17.0\testng-xslt</reportDir>
<reportFiles>index.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</actualHtmlPublisherTarget>
<outer-class reference="../actualHtmlPublisherTarget"/>
<wrapperChecksum>796cbf0a49a412ba89a93f58bbf63abf9f5af936</wrapperChecksum>
<outer-class defined-in="htmlpublisher.HtmlPublisherTarget$HTMLBuildAction" reference="../actualHtmlPublisherTarget"/>
</htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction>
<htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction plugin="htmlpublisher@1.10">
<actualHtmlPublisherTarget>
<reportName>ST Email HTML Report</reportName>
<reportDir>nm\QA_Automation\v17.0\SanityTestEmailReport</reportDir>
<reportFiles>STEmailReport.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</actualHtmlPublisherTarget>
<outer-class reference="../actualHtmlPublisherTarget"/>
<wrapperChecksum>ffc2f816b50b1c16b1039117586a3b4077678142</wrapperChecksum>
<outer-class defined-in="htmlpublisher.HtmlPublisherTarget$HTMLBuildAction" reference="../actualHtmlPublisherTarget"/>
</htmlpublisher.HtmlPublisherTarget_-HTMLBuildAction>
config.xml
<publishers>
<htmlpublisher.HtmlPublisher plugin="htmlpublisher@1.10">
<reportTargets>
<htmlpublisher.HtmlPublisherTarget>
<reportName>WUG TA HTML Report</reportName>
<reportDir>nm\QA_Automation\v17.0\WUGEmailableReport</reportDir>
<reportFiles>Results.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</htmlpublisher.HtmlPublisherTarget>
<htmlpublisher.HtmlPublisherTarget>
<reportName>TestNG XSLT Report</reportName>
<reportDir>nm\QA_Automation\v17.0\testng-xslt</reportDir>
<reportFiles>index.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</htmlpublisher.HtmlPublisherTarget>
<htmlpublisher.HtmlPublisherTarget>
<reportName>ST Email HTML Report</reportName>
<reportDir>nm\QA_Automation\v17.0\SanityTestEmailReport</reportDir>
<reportFiles>STEmailReport.html</reportFiles>
<alwaysLinkToLastBuild>false</alwaysLinkToLastBuild>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
</htmlpublisher.HtmlPublisherTarget>
</reportTargets>
</htmlpublisher.HtmlPublisher>
</publishers>
Please provide the output of the following script when run in Manage Jenkins » Script Console:
java.nio.charset.Charset.defaultCharset()
Have the same issue.
Master is on Ubuntu 15.04
And the script output is:
UTF-8
I also have the problem that I usually get the "Checksum mismatch" error. (Jenkins and all plugins are up-to-date.)
I hope I can shed some light on the problem. There are certain conditions I have noticed.
- The problem does not occur when there is a single HTML report.
- The problem does not occur for the first HTML report.
- The incorrect checksum is reported, an example:
"The checksum of the current wrapper file (checksum from 2nd report) does not match the recorded checksum (checksum from 1st report)." - Sometimes no error is reported, so it may not be deterministic.
- The problem does not occur if you select the job and open the report from left column.
Checksum error -> http://.../job/JOB-NAME/HTML-NAME
No checksum error -> http://.../job/JOB-NAME/JOB-ID/HTML-NAME
jonw Thanks for the detailed analysis! It helps a lot. I'll see what I can do. I'll be traveling next week, so I hope to get this done this week. No promises though.
Same issue
RHEL 6.5
Jenkins 1.645
HTML Publisher plugin 1.10
Output from script console: UTF-8
Great finding Jon! Yes that is applicable for us as well, we have several reports per job.
Note: I cannot reproduce the error if I only create 2 reports, I also must mark the publishing option: 'Keep past HTML reports'
jonw (and everyone else watching): Proposed fix at https://github.com/jenkinsci/htmlpublisher-plugin/pull/23
Please take a look, maybe give the PR build https://jenkins.ci.cloudbees.com/job/plugins/job/htmlpublisher-plugin/61/ a try?
Thanks for the quick fix. I only tested it superficially, but it looks good.
> Note: I cannot reproduce the error if I only create 2 reports, I also must mark the publishing option: 'Keep past HTML reports'
This was my experience as well but I was unsure about it and not sure if it was relevant.
Yep, it's important, otherwise a different branch in the code is taken. So you need a) multiple reports per build, b) archiving reports of past builds, c) access reports through project-level links. Therefore the instructions how to reproduce the issue were essential.
(This is really a bit of a hack because if you archive reports for past build, it switches to a different mode in which reports are attached to builds rather than to the project, and the project-level links essentially forward to the build-level archive… and that's where I messed up the checksum change for 1.10 – but it's only apparent when you archive multiple different reports.)
Code changed in jenkins
User: Daniel Beck
Path:
src/main/java/htmlpublisher/HtmlPublisherTarget.java
http://jenkins-ci.org/commit/htmlpublisher-plugin/014ee3838bc5a617e2cf6474423099c34e947abe
Log:
[FIX JENKINS-32281] Consider multiple reports per build
Code changed in jenkins
User: Mike Rooney
Path:
src/main/java/htmlpublisher/HtmlPublisherTarget.java
http://jenkins-ci.org/commit/htmlpublisher-plugin/9dd6fe1ea02d48ea411125b54369752f5be4f494
Log:
Merge pull request #23 from daniel-beck/JENKINS-32281
[FIX JENKINS-32281] Consider multiple reports per build
Compare: https://github.com/jenkinsci/htmlpublisher-plugin/compare/4a8d86addf84...9dd6fe1ea02d
I converted all of my custom reports to plugin-based-reports! If no one else can repro the fix, I'll try to spin up one of my older configurations.
I tried wiping out the workspace and that didn't change anything.