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

Process 'Gradle SpotBugs Worker 4' finished with non-zero exit value 1 #11

Closed
hongqijia opened this issue Feb 26, 2018 · 15 comments · Fixed by #60
Closed

Process 'Gradle SpotBugs Worker 4' finished with non-zero exit value 1 #11

hongqijia opened this issue Feb 26, 2018 · 15 comments · Fixed by #60

Comments

@hongqijia
Copy link

  • What went wrong:
    Execution failed for task ':Core:spotbugsMain'.

Failed to run Gradle SpotBugs Worker
Process 'Gradle SpotBugs Worker 5' finished with non-zero exit value 1

  • 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 ':Core:spotbugsMain'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
    at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:623)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:578)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: org.gradle.process.internal.worker.WorkerProcessException: Failed to run Gradle SpotBugs Worker
    at org.gradle.process.internal.worker.WorkerProcessException.runFailed(WorkerProcessException.java:29)
    at org.gradle.process.internal.worker.DefaultSingleRequestWorkerProcessBuilder$1.invoke(DefaultSingleRequestWorkerProcessBuilder.java:126)
    at com.sun.proxy.$Proxy86.runSpotbugs(Unknown Source)
    at com.github.spotbugs.internal.spotbugs.SpotBugsWorkerManager.runWorker(SpotBugsWorkerManager.java:15)
    at com.github.spotbugs.SpotBugsTask.run(SpotBugsTask.java:235)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:788)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:755)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
    ... 30 more
    Caused by: org.gradle.process.internal.ExecException: Process 'Gradle SpotBugs Worker 5' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:389)
    at org.gradle.process.internal.worker.DefaultWorkerProcess.onProcessStop(DefaultWorkerProcess.java:118)
    at org.gradle.process.internal.worker.DefaultWorkerProcess.access$000(DefaultWorkerProcess.java:41)
    at org.gradle.process.internal.worker.DefaultWorkerProcess$1.executionFinished(DefaultWorkerProcess.java:74)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy71.executionFinished(Unknown Source)
    at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:207)
    at org.gradle.process.internal.DefaultExecHandle.finished(DefaultExecHandle.java:334)
    at org.gradle.process.internal.ExecHandleRunner.completed(ExecHandleRunner.java:102)
    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:82)
    at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
    ... 3 more

@jeven2016
Copy link

I encountered this issue as well ....................
plugins {
id "com.github.spotbugs" version "1.6.1"
}
spotbugs {
toolVersion = "3.1.2"
}

@hongqijia
Copy link
Author

hongqijia commented Mar 6, 2018

I resolve this by changing org.apache.ws.commons.axiom:axiom-api from a newer version to 1.2.13. in my project's dependencies.
But in another project with spring framework dependencies, this issue came up again and never go away no matter what I tried. So I have to give up on using spotBugs for my projects.

@JewelPengin
Copy link

I'm having the same issue as well. If I run a --debug I'm able to see the worker is having an SLF4J issue (my favorite).

08:07:26.163 [DEBUG] [system.err] SLF4J: Found binding in [jar:file:/Users/jolarson/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.7/8095d0b9f7e0a9cd79a663c740e0f8fb31d0e2c8/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
08:07:26.164 [DEBUG] [system.err] SLF4J: Found binding in [jar:file:/Users/jolarson/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.5/6edffc576ce104ec769d954618764f39f0f0f10d/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
08:07:26.164 [DEBUG] [system.err] SLF4J: Found binding in [jar:file:/usr/local/Cellar/gradle/4.6/libexec/lib/gradle-logging-4.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
08:07:26.164 [DEBUG] [system.err] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
08:07:26.166 [DEBUG] [system.err] SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
08:07:26.323 [DEBUG] [system.err] java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory cannot be cast to org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext
08:07:26.323 [DEBUG] [system.err]       at org.gradle.internal.logging.slf4j.Slf4jLoggingConfigurer.configure(Slf4jLoggingConfigurer.java:42)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.internal.logging.config.LoggingSystemAdapter.startCapture(LoggingSystemAdapter.java:54)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:297)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:73)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:37)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:83)
08:07:26.323 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:64)
08:07:26.323 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:62)
08:07:26.323 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:67)
08:07:26.359 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
08:07:26.359 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle SpotBugs Worker 80' finished with exit value 1 (state: FAILED)

Unfortunately for me, this is somehow being loaded outside of the dependency tree. If I do a gradle dependencies everything is overridden by my root project version, but somehow those are creeping in.

I'll continue to investigate, but I'd greatly appreciate it if someone has some magic way of identifying these easily.

@JewelPengin
Copy link

So I was able to override the multiple bindings correctly (as plugin classpaths are different than build classpaths) and ensure everything was using the same slf4j version. I upgraded to the latest 1.8.0-beta1 of slf4j (since I'm using Java 9). I get pretty much the same error.

08:45:41.683 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
08:45:41.683 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: Gradle SpotBugs Worker 3.
08:45:41.698 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
08:45:41.698 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'Gradle SpotBugs Worker 3'
08:45:41.698 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
08:45:42.317 [DEBUG] [system.err] SLF4J: No SLF4J providers were found.
08:45:42.317 [DEBUG] [system.err] SLF4J: Defaulting to no-operation (NOP) logger implementation
08:45:42.318 [DEBUG] [system.err] SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
08:45:42.323 [DEBUG] [system.err] SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
08:45:42.324 [DEBUG] [system.err] SLF4J: Ignoring binding found at [jar:file:/usr/local/Cellar/gradle/4.6/libexec/lib/gradle-logging-4.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
08:45:42.324 [DEBUG] [system.err] SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.
08:45:42.488 [DEBUG] [system.err] java.lang.ClassCastException: org.slf4j.helpers.NOPLoggerFactory cannot be cast to org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext
08:45:42.488 [DEBUG] [system.err]       at org.gradle.internal.logging.slf4j.Slf4jLoggingConfigurer.configure(Slf4jLoggingConfigurer.java:42)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.internal.logging.config.LoggingSystemAdapter.startCapture(LoggingSystemAdapter.java:54)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:297)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:73)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.internal.logging.services.DefaultLoggingManager.start(DefaultLoggingManager.java:37)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:83)
08:45:42.489 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:64)
08:45:42.489 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:62)
08:45:42.489 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:67)
08:45:42.518 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
08:45:42.519 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle SpotBugs Worker 3' finished with exit value 1 (state: FAILED)

Are we colliding with the gradle logger?

@jonatanloya
Copy link

Can you share your build.gradle?

@davidafsilva
Copy link

I'm having similar issues, but the cause seems to be heap size.

[ERROR] [system.err] java.lang.OutOfMemoryError: Java heap space
[ERROR] [system.err]     at java.util.ArrayList.<init>(ArrayList.java:153)
[ERROR] [system.err]     at org.gradle.internal.remote.internal.inet.MultiChoiceAddressSerializer.read(MultiChoiceAddressSerializer.java:35)
[ERROR] [system.err]     at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:67)
[ERROR] [system.err]     at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:45)
[ERROR] [system.err]     at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:62)
[ERROR] [system.err]     at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:67)
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle SpotBugs Worker 6' finished with exit value 1 (state: FAILED)

I've already tried to increase it through the maxHeapSize property of the SpotBugsTask with no luck.

My configuration is the following:

    plugins.withType(SpotBugsPlugin) {
        spotbugs {
            toolVersion = '3.1.2'
            ignoreFailures = true
            effort = 'max'
            reportLevel = 'low'
        }
    }

Any tips?

@dclements
Copy link

dclements commented May 8, 2018

Same issue, with the same ClassCastException @JewelPengin was seeing.

id "com.github.spotbugs" version "1.6.0"

and

spotbugs {
  toolVersion = '3.1.3'
}

@jonatanloya
Copy link

The problem is, you have many slf4j libraries

@shekhargulati
Copy link

I solved this problem by stopping the daemon and executing the build again. To stop the Gradle daemon, you can use following command

./gradlew --stop

@zxkane
Copy link

zxkane commented Jun 15, 2018

Similar problem when using latest spotbugs plugin 1.6.2,

:spotbugsIntegTest (Thread[Task worker for ':',5,main]) started.

> Task :spotbugsIntegTest FAILED
Excluding []
Excluding []
Task ':spotbugsIntegTest' is not up-to-date because:
  Task has failed previously.
Starting process 'Gradle SpotBugs Worker 2'. Working directory: /Users/kane/git/pilipa/accounting/configserver Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=CN -Duser.language=zh -Duser.variant -cp /Users/kane/.gradle/caches/4.5.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle SpotBugs Worker 2'
Successfully started process 'Gradle SpotBugs Worker 2'

:spotbugsIntegTest (Thread[Task worker for ':',5,main]) completed. Took 0.758 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotbugsIntegTest'.
> Failed to run Gradle SpotBugs Worker
   > Process 'Gradle SpotBugs Worker 2' finished with non-zero exit value 1

I'm building a spring web project, this error happened after introducing spring-cloud-contract 2.0.0.RC2 for contract driven testing.

Any hint for dumping the detail error of spotbugs plugin?

@plorenz
Copy link

plorenz commented Jun 15, 2018

@zxkane I ran with --debug and then looked for stderr in the output

Adding

exclude group:'ch.qos.logback'
to the buildscript configurations.classpath block fixed the issue for me, as I was having the slf4j problem as well

@geekbeast
Copy link

For those having conflicts with org.slf4j.impl.SimpleLoggerFactory adding configurations.classpath { exclude module: 'slf4j-simple' } seems to do the trick.

@geekbeast
Copy link

For some reason excluding by group still caused problems.

@ThrawnCA
Copy link
Contributor

ThrawnCA commented Jul 9, 2018

Excluding slf4j-simple and Logback didn't help when trying to set up SLF4J within SpotBugs itself.

I suspect gradle/gradle#2657 / gradle/gradle#4981

@DPUkyle
Copy link
Contributor

DPUkyle commented Oct 10, 2018

I believe my PR #58 fixes this. Please retest.

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

Successfully merging a pull request may close this issue.