feedback
feedback copied to clipboard
Unknown error processing JaCoCo coverage report XML files
Describe the bug Starting August 29, Codecov has encountered an "unknown error" processing XML reports generated by JaCoCo for my project. It succeeded for this commit but then failed in this commit and every run since. I did not make any changed to the Codecov configuration at the time.
My workflow is using Github Actions with the codecov action (v3, and also recently using a specific commit to match the configuration of another project, detekt, without success). The codecov actions step completes successfully (sample run), but reports an unknown error on the codecov site (sample result), so this appears to be an issue on Codecov's backend rather than the CI setup. There aren't any details for this error that I could find, so debugging further is difficult, but I did verify that the file paths appear to be correct per this reference article. I also verified that the report XML is at least valid XML (although it's too large for me to meaningfully parse through manually).
Environment (please complete the following information):
- System (e.g., local machine, CI, etc) CI via GitHub Actions; v3
- JaCoCo version: 0.8.10 (latest) via Gradle 8.3 (latest)
To Reproduce I don't have a self-contained reproducer, but the issue can be seen for my project here.
Expected behavior Coverage reports should be processed successfully and reflected in the Codecov UI. This was working until approximately August 29.
Screenshots N/A
Additional context N/A
@dzirbel Can you try to rerun the commit and see if it works?
@jessecodecov I've just run it again with the same unknown error: https://app.codecov.io/github/dzirbel/kotify/commit/117e0399566f64d84b06e133e0b8e9dd8cff70cc (and this has happened for the last ~20 commits: https://app.codecov.io/github/dzirbel/kotify/commits)
@dzirbel Looks like under the network tab in the coverage report, where the paths are shown I can see a difference between the reports that are working and the reports that are showing "unknown error"
for the working path..It appears to be "/build/reports/jacoco/jacocoTestReportIntegration/jacocoTestReportIntegration.xml"
For the non working path it appears to be "/build/reports/jacoco/jacocoTestReportLocal/jacocoTestReportLocal.xml"
Not sure what happened but, seems like the path did end up changing.
I have two different CI jobs, one of which runs only local unit tests and another which runs integration tests that depend on the network, so it makes sense that the generated report might be different between some runs. But recent runs of the integration test CI job also run into the same network error, for example https://app.codecov.io/github/dzirbel/kotify/commit/6ad28447eb836f7768c322ab60bf8facdbd658e1 has runs of both CI jobs, both failing.
Some of the older runs before August 29 look interesting, for example:
- https://app.codecov.io/github/dzirbel/kotify/commit/f06d03add0e4c6f92baded9e3a89b1fd2ba5a291 has successes for both local and integration test jobs
- https://app.codecov.io/github/dzirbel/kotify/commit/7a51c48c080c6274959b47e7b400191b3e1ef9d1 has an unknown error, but still some successes via "carried forward"
- https://app.codecov.io/github/dzirbel/kotify/commit/8302361dabb135584eb6c8264cf0fc0e9b9e6c03 now has 2/3 errors
I do have carryfoward enabled in my YML, so perhaps that is related? But it is a feature I have been relying on for some time, to combine the reports from these local and integration test jobs.
@jessecodecov wanted to bump this again; I'm still seeing unknown errors on all my runs, even after adjusting my YAML settings in various ways and removing the carryforward flag (here). I've validated my YAML and compared codecov's output for my project against this one from another project; they look essentially identical. At this point I'm not sure what else I can do, because as best I can tell this is a blocking bug entirely within codecov's parsing on my reports.
Hi @dzirbel ,
Sorry for the delay here. We've all been taking turns getting sick (not intentionally) so staffing has been a little off. Anyway...
It looks like your Jacoco reports contain a number of values of coverage for line="0", which isn't valid. Since it's a case that we never expected to see in a report, the processor is crashing and that's why you aren't getting any form of decent error.
I looked at https://app.codecov.io/github/dzirbel/kotify/commit/7a907d4b95e4ff1a73efaa76de06eebcc7f6ab7e as am example.
Here's an example from that download of what I'm referring to:
<class name="com/dzirbel/kotify/ui/page/album/AlbumPageKt$AlbumHeader$lambda$10$lambda$9$lambda$8$$inlined$flatMapLatest$1" sourcefilename="Merge.kt">
<method name="invokeSuspend" desc="(Ljava/lang/Object;)Ljava/lang/Object;" line="0">
Here is the exact line where Codecov is crashing: https://github.com/codecov/shared/blob/36cea1a0ec45a333fbbd0b89ae1ca3860e17e6d1/shared/reports/resources.py#L239
Unfortunately, I don't have any ideas why Jacoco would be reporting that you have methods on line 0. do you reememebr updating anything between when it started working and when it didn't? Maybe a dependency that isn't pinned?
Thanks so much for the detailed investigation @drazisil-codecov! I should have mentioned it before, but around the time I started seeing this issue I did upgrade the version of Compose Multiplatform. Since that runs as a Kotlin compiler plugin, I could definitely imagine it causing issues like this (the example you provided - AlbumHeader() in AlbumPage.kt - is a Composable function with extra code generated by Compose).
In a brief search, I don't see any reports of this for the Compose project at the moment. I'll be away from my computer for the rest of the day but I'll file a report with them when I get back.
Hi @dzirbel I faced a similar issue with JaCoCo v0.8.9 & Gradle 8.2 When I downgraded the version to 0.8.8, it worked as expected. Perhaps this could be helpful anyone
Based on the comment from @adel-khalifa , I have a slight suspicion that perhaps jacoco changed something about their coverage report output. We will have @nora-codecov investigate if this is the case. If so, we can update our processor to accept the new version
As far as I can tell, this seems to be an issue that is being escalated via the proper channels in the jacoco community. I'm not sure if there's much we can do on the codecov end to resolve this directly. Issue:
https://github.com/Kotlin/kotlinx.coroutines/issues/3911
closing for now. If this persists after work on the jacoco side, we can re-open and investigate.