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

[V1.6.0 -> V1.7.4] Error reading configuration file, java.util.zip.ZipException: invalid code lengths set. #2582

Closed
hangduykhiem opened this issue Apr 6, 2020 · 4 comments · Fixed by #2703

Comments

@hangduykhiem
Copy link

Expected Behavior

Detekt gradle task finish successfully when there are changes to custom RuleProvider or Rule.

Observed Behavior

Detekt gralde task failed with the following stack.

Caused by: java.util.ServiceConfigurationError: io.gitlab.arturbosch.detekt.api.RuleSetProvider: Error reading configuration file
        at io.gitlab.arturbosch.detekt.core.RuleSetLocator.load(RuleSetLocator.kt:29)
        at io.gitlab.arturbosch.detekt.cli.config.DefaultPropertiesConfigValidator$validate$1.invoke(DefaultPropertiesConfigValidator.kt:20)
        at io.gitlab.arturbosch.detekt.cli.config.DefaultPropertiesConfigValidator.validate(DefaultPropertiesConfigValidator.kt:27)
        at io.gitlab.arturbosch.detekt.cli.config.ConfigValidatorsKt.checkConfiguration(ConfigValidators.kt:15)
        at io.gitlab.arturbosch.detekt.cli.runners.Runner.execute(Runner.kt:31)
        at io.gitlab.arturbosch.detekt.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:51)
        ... 89 more
Caused by: java.util.zip.ZipException: invalid code lengths set
        ... 95 more

Steps to Reproduce

  1. Remove a rule from a RuleProvider
  2. Run gradle detekt task.

Your Environment

  • Version of detekt used: v1.7.4
  • Version of Gradle used (if applicable): v5.6.4
  • Operating System and version: Mac OSX 10.14 Mojave and Arch 5.5.4-arch1-1
@hangduykhiem
Copy link
Author

More reproduction:

  1. Run ./gradlew detekt on current master
  2. Remove for example the rule ChainWrapping from file io.gitlab.arturbosch.detekt.formatting.KtLintMultiRule
  3. Rerun the gradle task

@arturbosch
Copy link
Member

This happens due to classloader caching of the newer Gradle plugins (1.7.0+).
What you can do is to stop all daemons with gradle --stop and restart with a fresh classloader or start builds without a daemon gradle build --no-daemon.

I think we should introduce an additional timestamp comparision ...

@hangduykhiem
Copy link
Author

Yup, stopping all the gradle daemon seems to be a good temporary solution. 👍

@arturbosch
Copy link
Member

arturbosch commented May 12, 2020

I've added the regression and api tag as this hurts all extension authors.
So imo this is now a blocker.
I will experiment with simple/cheap hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants