-
Bug
-
Resolution: Fixed
-
Minor
-
Windows Server, running Jenkins 1.576 or 1.577 as service.
-
Powered by SuggestiMate
Since Jenkins 1.576 (running as Windows service), some weather icons are missing. Instead, only the percentage is printed. This happens for some jobs, not for others. (it happen to be Maven jobs, I don't know whether that is relevant).
This issue started in 1.576 (where also some plugin icons in the sidebar went missing), but persists in the latest 1.577.
Note that the image apparently is loaded correctly, as some other jobs in the same percentage range get their icon printed correctly.
When looking at the html sources of the broken icons, the img tag seems to be missing the src attributes with the image filename.
Note that the same issue also occurs on the project details page, where the weather icons is normally printed at the top of the recent builds list.
[JENKINS-24407] missing weather icons (randomly?)
Would be interesting to know whether the working weather icons are percentages evenly dividable by 20.
In my attached screenshot, the working icons are 81%, 80%, 21%, 60%, 100% respectively. Not in this screenshot, but we also have jobs with 66%, 75%, 51%, 68%, 23%, 64%, 44%, etc... working correctly.
I have this very bad feeling that any non-default weather report icons are no longer supported by core (e.g. various test or code coverage report plugins, or Cloudbees Folders Plus).
When you mouseover over the weather icons, a tooltip/popup should show up showing 1 or more "weather reports" for specific things (like X out of 5 builds failed, or percentage of tests failed, ...). Check to see which weather report is the worst for every weather icon.
There should be a common thread to the icons that work, and the icons that don't. Example: "the icon is shown when the worst report is "X out of 5 builds failed", and it isn't shown when the worst is "test code coverage".
Indeed, when looking at the tooltip, only Cobertura status weather icons (from the Cobertura Plugin) seem missing.
In the cases where the icon is missing, Cobertura is indeed the one with the worst percentage (and the Cobertura line is missing its icon).
However, there are jobs where Cobertura has the worst percentage, and its icon is not missing; in which case the overall icon isn't missing either.
(see screenshots)
I can confirm that I'm seeing the same problem on our jobs that use Cobertura.
Hi guys.
Can we confirm is it only when Jenkins is running as a Windows Service, or does that matter?
I did a quick test on this locally but failed to reproduce (using latest source on OSX). Would it be possible for someone that has this issue to:
1. Create a public test project in their github that uses Cobertura (or other) and can be used in #2
2. Provide a sample job (that uses the test project from #1) that I can install locally that reproduces the issue
Also seeing this on Debian (Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux) running Jenkins ver. 1.577 with Cobertura plugin.
buildHealth.jelly is missing support for HealthReport subclasses that don't set iconClassName because it's private and has no setter. Very backwards-incompatible. Unfortunately, the Cobertura plugin doesn't seem to subclass it.
Darren.... is there any way you could create a setup that can be sent to me to reproduce this?
Related regression: HealthReport completely lost support for indeterminate build health, e.g. for a newly created job (via the parameterless constructor). It'll just report good health (sun icon) instead of no icon.
Could someone please share a few projects' config.xml and their most recent build's build.xml (I don't think we need coverage.xml for the weather) for projects where this issue occurs? Both can be stripped of any private data, as long as loading both into Jenkins still results in the icon missing. I set up Cobertura on a Maven project, played around with options, thresholds etc., and it always reports "real" weather icons, nothing missing.
If it works "out of the box" on some open source project (like a Jenkins plugin) see we can actually build and watch it fail that would be even better.
Attached a config.xml and last build.xml (files have been cleaned a bit, with some private or redundant data stripped).
These xml files were taken from a jenkins instance where the originating job shows 87%, but no weather icon. When putting them in another jenkins instance (1.577) the weather icon is missing as well.
Note: this occurs on both a Windows service instance and a standalone run (i.e. java -jar jenkins.war)
Note that simply reverting jenkins to 1.575 resolves the issue.
So obviously someone has just broken something in 1.576.
I don't think there were that may commits integrated in 1.576 ?? So there can't be that much source lines involved and it shouldn't be too hard to pinpoint the problem for someone knowing the jenkins code?
https://github.com/jenkinsci/jenkins/compare/jenkins-1.575...jenkins-1.576
Just 62 commits changing 263 files, nothing major
Missed your earlier comment, will try to reproduce the problem later today.
For what it's worth, we're able to fix the weather icons by rebuilding the projects (which re-runs Cobertura).
Reproduced the issue with the data provided by belpk: The 87% (worst health) HealthReport in question was serialized to disk from before the icon classname field existed (attached build.xml starting at line 581), and deserialization does not call the constructor, leaving the field null, hence no icon.
There's no implementation of readResolve() in HealthReport, and ConverterImpl ignores this issue.
Any builds created after the Jenkins update should contain the field in serialized form, and therefore show up correctly (making reproducing it rather difficult!).
I'm preparing a fix right now.
A workaround for everyone affected and not willing to wait for a fix would be to script changes to affected build.xml files. For every line like this:
<iconUrl>health-80plus.png</iconUrl>
Add a line below like this:
<iconClassName>icon-health-80plus</iconClassName>
Repeat for all other pairs of icon class name/icon URL defined here:
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/HealthReport.java#L50
Then reload configuration from disk.
tfennelly: The following change causes the HealthReport to inialize properly from old on-disk data:
https://github.com/daniel-beck/jenkins/commit/3a18c6ba1092bee3a0b1903aa42e838b37a72a60
I'll create a PR for it if you don't merge this change by late Friday UTC so it has a chance to get in 1.580.
lowering priority, as eventually this should fix itself (after all jobs have run again - depends on the user's setup and workflow of course) and so doesn't seem broken permanently...
Awesome... thanks guys (KP, Daniel, Mike etc). @Daniel... I'll look at that change/PR and merge it into master (after running a test build of course).
Code changed in jenkins
User: Daniel Beck
Path:
core/src/main/java/hudson/model/HealthReport.java
http://jenkins-ci.org/commit/jenkins/990a84f75396fe942d2cbc690a7c047223b648dd
Log:
[FIXED JENKINS-24407] Restore icon class name during deserialization
Thanks Daniel... I pushed your fix upstream. I tweaked it very slightly... I'm sure you don't mind.
Integrated in jenkins_main_trunk #3667
[FIXED JENKINS-24407] Restore icon class name during deserialization (Revision 990a84f75396fe942d2cbc690a7c047223b648dd)
Result = SUCCESS
tom.fennelly : 990a84f75396fe942d2cbc690a7c047223b648dd
Files :
- core/src/main/java/hudson/model/HealthReport.java
Tom: No problem, I just didn't bother to do that. It's nicer like this.
Fix will be in 1.580 scheduled for release in ~10 days or so.
Speculatively assigning to Tom who wrote the icon tag.
Would be interesting to know whether the working weather icons are percentages evenly dividable by 20.