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

Errors running detekt in the detekt project #2484

Closed
BraisGabin opened this issue Mar 22, 2020 · 4 comments
Closed

Errors running detekt in the detekt project #2484

BraisGabin opened this issue Mar 22, 2020 · 4 comments
Labels
Milestone

Comments

@BraisGabin
Copy link
Member

Letely when I use ./gradlew detekt in the detekt project itself I'm getting some flaky behaviour. Sometimes it works (it finds the issues if there are any) and sometimes fails with different errors:

Ignoring listeners of task graph ready event, as this build (:detekt-gradle-plugin) has already executed work.
> Task :detekt-api:detekt FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt-api:detekt'.
> JAR entry default-detekt-config.yml not found in /Users/brais/projects/detekt/detekt-cli/build/libs/detekt-cli-1.7.0.jar

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':detekt-api:detekt'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.GradleException: JAR entry default-detekt-config.yml not found in /Users/brais/projects/detekt/detekt-cli/build/libs/detekt-cli-1.7.0.jar
        at io.gitlab.arturbosch.detekt.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:58)
        at io.gitlab.arturbosch.detekt.Detekt.check(Detekt.kt:214)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:727)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:694)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:568)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
        ... 30 more
Caused by: java.io.FileNotFoundException: JAR entry default-detekt-config.yml not found in /Users/brais/projects/detekt/detekt-cli/build/libs/detekt-cli-1.7.0.jar
        at io.gitlab.arturbosch.detekt.api.internal.YamlConfig$Companion.loadResource(YamlConfig.kt:65)
        at io.gitlab.arturbosch.detekt.cli.ConfigurationsKt.loadDefaultConfig(Configurations.kt:75)
        at io.gitlab.arturbosch.detekt.cli.ConfigurationsKt.loadConfiguration(Configurations.kt:34)
        at io.gitlab.arturbosch.detekt.cli.runners.Runner.createSettings(Runner.kt:78)
        at io.gitlab.arturbosch.detekt.cli.runners.Runner.execute(Runner.kt:30)
        at io.gitlab.arturbosch.detekt.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:51)
        ... 93 more


* Get more help at https://help.gradle.org

BUILD FAILED in 2s
19 actionable tasks: 1 executed, 18 up-to-date

or even:

Ignoring listeners of task graph ready event, as this build (:detekt-gradle-plugin) has already executed work.
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt}
Attempting to read last messages from the daemon log...
Daemon pid: 10225
  log file: /Users/brais/.gradle/daemon/6.2.1/daemon-10225.out.log
----- Last  20 lines from daemon log file - daemon-10225.out.log -----
2020-03-22T15:49:50.120+0100 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 482: Received non-IO message from client: Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt}
2020-03-22T15:49:50.120+0100 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt}.
2020-03-22T15:49:50.120+0100 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt} with connection: socket connection from /127.0.0.1:51055 to /127.0.0.1:51181.
2020-03-22T15:49:50.120+0100 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt}, connection = DefaultDaemonConnection: socket connection from /127.0.0.1:51055 to /127.0.0.1:51181] after 1.0 minutes of idle
2020-03-22T15:49:50.120+0100 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [86caf51b-4cbb-456a-92f4-830f869cfa24 port:51055, addresses:[localhost/127.0.0.1]]
2020-03-22T15:49:50.120+0100 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [86caf51b-4cbb-456a-92f4-830f869cfa24 port:51055, addresses:[localhost/127.0.0.1]]
2020-03-22T15:49:50.121+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2020-03-22T15:49:50.121+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-03-22T15:49:50.121+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2020-03-22T15:49:50.121+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
2020-03-22T15:49:50.122+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
2020-03-22T15:49:50.122+0100 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=f3a7ae3c-48e4-43fe-8d9c-56e2e6df8e93, currentDir=/Users/brais/projects/detekt}. Dispatching build started information...
2020-03-22T15:49:50.122+0100 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 484: dispatching org.gradle.launcher.daemon.protocol.BuildStarted@3e46771f
2020-03-22T15:49:50.122+0100 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/brais/Library/Android/sdk/tools/bin:/Users/brais/Library/Android/sdk/tools/:/Users/brais/Library/Android/sdk/platform-tools:/Applications/Postgres.app/Contents/Versions/latest/bin, JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home, TERM=xterm-256color, LANG=es_ES.UTF-8, ANDROID_HOME=/Users/brais/Library/Android/sdk, DISPLAY=/private/tmp/com.apple.launchd.SzssujIvA0/org.macosforge.xquartz:0, LOGNAME=brais, XPC_SERVICE_NAME=0, PWD=/Users/brais/projects/detekt, TERM_PROGRAM_VERSION=433, SHELL=/bin/zsh, JAVA_MAIN_CLASS_10565=org.gradle.wrapper.GradleWrapperMain, TERM_PROGRAM=Apple_Terminal, PAGER=less, LSCOLORS=Gxfxcxdxbxegedabagacad, APP_ICON_10565=/Users/brais/projects/detekt/media/gradle.icns, OLDPWD=/Users/brais/projects/detekt, USER=brais, APP_NAME_10565=Gradle, ZSH=/Users/brais/.oh-my-zsh, TMPDIR=/var/folders/j0/zqwr2hnd21dg5kbgxcmtf6zw0000gn/T/, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.0lfoWxO4E3/Listeners, XPC_FLAGS=0x0, TERM_SESSION_ID=EE7294BA-A7FB-4D4A-8535-EC9AA5FA708F, __CF_USER_TEXT_ENCODING=0x1F5:0:0, LESS=-R, LC_CTYPE=es_ES.UTF-8, HOME=/Users/brais, SHLVL=1}
2020-03-22T15:49:50.122+0100 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
2020-03-22T15:49:50.122+0100 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 10225). The daemon log file: /Users/brais/.gradle/daemon/6.2.1/daemon-10225.out.log
2020-03-22T15:49:50.123+0100 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting 9th build in daemon [uptime: 9 mins 7.298 secs, performance: 99%, GC rate: 0,01/s, heap usage: 16% of 358,1 MB, non-heap usage: 67% of 268,4 MB]
2020-03-22T15:49:50.123+0100 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
2020-03-22T15:49:50.123+0100 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=04105ae1-2f53-4c52-8e03-885fed5b8f42,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home,daemonRegistryDir=/Users/brais/.gradle/daemon,pid=10225,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=ES,-Duser.language=es,-Duser.variant]
Ignoring listeners of task graph ready event, as this build (:detekt-gradle-plugin) has already executed work.
----- End of the daemon log -----


FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

I don't get these erros using the same command in other projects.

It seems something related with our configuration to get detekt check itself with the last code.

@BraisGabin BraisGabin changed the title Error running detekt in the detekt project Errors running detekt in the detekt project Mar 22, 2020
@arturbosch
Copy link
Member

arturbosch commented Mar 22, 2020

As you already mentioned it is how we bootstrap our self analysis.
With 1.7 we cache the classloader/jars, if we now have any signature changes, the jvm reports corrupted jars...
We could introduce stronger checks than !lastClasspath.minus(classpath).isEmpty for development mode, like md5 hashes?

@3flex
Copy link
Member

3flex commented Sep 8, 2020

I'm seeing errors like this too - is there a solution? Reopening for now...

@3flex 3flex reopened this Sep 8, 2020
@arturbosch
Copy link
Member

Restarting the Gradle daemon helps here gradle --stop && gradle build.
See #2957 and #3047

@BraisGabin
Copy link
Member Author

This error is tracked in #2957 so we can close this one.

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

No branches or pull requests

3 participants