Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent error output: "Error executing FreeMarker template" #446

Closed
mgroth0 opened this issue Aug 9, 2023 · 5 comments · Fixed by #469
Closed

Intermittent error output: "Error executing FreeMarker template" #446

mgroth0 opened this issue Aug 9, 2023 · 5 comments · Fixed by #469
Assignees
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch

Comments

@mgroth0
Copy link

mgroth0 commented Aug 9, 2023

Describe the bug

Randomly every so often I see the output Error executing FreeMarker template. I'm not 100% sure it is from kover, but maybe 98% sure. There is no other output, and it is printed to standard error.

Upon searching for this output, I see that FreeMarker is in fact used in IntelliJ's (and thus Kover's) code coverage. Also, I never saw this output before I started using Kover myself.

Code coverage seems to otherwise work completely as expected.

Errors

Error executing FreeMarker template in red (standard error). That's it.

Expected behavior

As I said above code coverage seems to still proceed normally.

If the FreeMarker error is handled internally, than the error should not be shown to the user as it is non-actionable, unless the user's log level is high. My org.gradle.logging.level is set to warn, so I don't expect to see any output unless it has a purpose of informing me of an issue.

If the error is not completely handled, and is in fact something that we should be concerned about, then there should be a full stack trace and a more informative message.

Reproducer

I cannot reproduce it. It happens at random. If there was a full stack trace or a more informative message I may be able to figure out how to reproduce it.

Environment

  • Kover Gradle Plugin version: 0.7.3
  • Gradle version: 8.2.1
  • Kotlin project type: Kotlin/Multiplatform + Android
  • Coverage Toolset: Kover
  • OS version: macOS 13.4.1

See the very place that this message is logged in FreeMarker here

@mgroth0 mgroth0 added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Aug 9, 2023
@mgroth0 mgroth0 changed the title Intermittent error output: "Error executing FreeMarker template". Intermittent error output: "Error executing FreeMarker template" Aug 9, 2023
@shanshin shanshin added S: in progress Status: implementing or design in process and removed S: untriaged Status: issue reported but unprocessed labels Aug 10, 2023
@shanshin
Copy link
Collaborator

Hi,
do these errors disappear if you add the -Dorg.freemarker.loggerLibrary=none system property in the Gradle build command?

@mgroth0
Copy link
Author

mgroth0 commented Aug 11, 2023

I will add this property now. I won't know for sure since I can't reproduce it, but we can check back in a few days and I can let you know if I still am seeing it.

@mgroth0
Copy link
Author

mgroth0 commented Aug 11, 2023

Although I am concerned that's not an ideal solution. What if one day there is a FreeMarker-related issue that I do need to see the output for? The above property could cause a subtle and hard to fix bug in the future.

@shanshin
Copy link
Collaborator

Although I am concerned that's not an ideal solution. What if one day there is a FreeMarker-related issue that I do need to see the output for? The above property could cause a subtle and hard to fix bug in the future.

This is a temporary solution until we fix this problem locally in our code.

shanshin added a commit that referenced this issue Sep 22, 2023
… report

Due to an untraceable error of FreeMarker templates, repeated attempts to generate a report are triggered in some cases. In case of unsuccessful attempts, FreeMarker writes to its logger, which is sent to stdout by default.
If the error repeats frequently, an exception will be thrown with an error message - so we can ignore FreeMarker's own logging when generating an HTML report.

Fixes #446
shanshin added a commit that referenced this issue Oct 10, 2023
… report

Due to an untraceable error of FreeMarker templates, repeated attempts to generate a report are triggered in some cases. In case of unsuccessful attempts, FreeMarker writes to its logger, which is sent to stdout by default.
If the error repeats frequently, an exception will be thrown with an error message - so we can ignore FreeMarker's own logging when generating an HTML report.

- upgraded IntelliJ Coverage Library to version `1.0.738`
- changed IntelliJ stdout logging level to error
- refactored code that works with Gradle Worker API
- small refactoring IntelliJ integration

Fixes #446
PR #469
@shanshin shanshin reopened this Oct 10, 2023
@shanshin shanshin added S: ready for release Status: merged in the main branch and removed S: in progress Status: implementing or design in process labels Oct 10, 2023
@shanshin
Copy link
Collaborator

Fixed in 0.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants