detekt: Getting "io.gitlab.arturbosch.detekt.api.RuleSetProvider: Error reading configuration file" error sometimes

We are getting this error from time to time when running ./gradlew detekt:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':base:detekt'.
> io.gitlab.arturbosch.detekt.api.RuleSetProvider: Error reading configuration file
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

Expected Behavior

No error

Observed Behavior

The build stops with an error. Running ./gradlew detekt --no-daemon solves the issue (but this is not good).

Steps to Reproduce

Just run ./gradlew detekt in a Gradle project with daemon enabled (we also use parallel builds if that matters)

Context

I have ./gradlew detekt as a pre-push git hook and want it to fail only when there are errors found by detekt (not by detekt failing itself). Adding --no-daemon is a waste of resources.

Your Environment

  • Version of detekt used:1.14.2
  • Version of Gradle used (if applicable): 6.8
  • Operating System and version: Linux Mint 20.1 Cinnamon
  • Link to your project (if it’s a public repository): private

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 29 (16 by maintainers)

Most upvoted comments

I believe #4120 would address this. Gradle & all other tasks could run on Java 8 while detekt runs on Java 11.

This might also mean we should set default minimum JDK of 11 for detekt tasks so this error goes away by default.