Deamon frequently disappears


(Marcin Grzejszczak) #1

Hi!

I’m using Gradle 3.5 and for I frequently get the DaemonDisappearedException.

➜  spring-cloud-contract-samples git:(rest_docs) ✗ ./gradlew generateDocumentation --stacktrace
:removeHtml
:asciidoctor
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=740324dc-201e-4a52-ac27-e52ec976da62.1, currentDir=/home/marcin/repo/spring-cloud-contract-samples}
Attempting to read last messages from the daemon log...
Daemon pid: 21094
  log file: /home/marcin/.gradle/daemon/3.5/daemon-21094.out.log
----- Last  20 lines from daemon log file - daemon-21094.out.log -----
14:00:13.313 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=740324dc-201e-4a52-ac27-e52ec976da62.1, currentDir=/home/marcin/repo/spring-cloud-contract-samples}, connection = DefaultDaemonConnection: socket connection from /0:0:0:0:0:0:0:1:37867 to /0:0:0:0:0:0:0:1:39766] after 0.0 minutes of idle
14:00:13.313 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [9c428336-dd88-4cb0-acaa-7d89ee0ae9f4 port:37867, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
14:00:13.314 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [9c428336-dd88-4cb0-acaa-7d89ee0ae9f4 port:37867, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
14:00:13.314 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
14:00:13.314 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
14:00:13.315 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
14:00:13.315 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
14:00:13.315 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
14:00:13.315 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=740324dc-201e-4a52-ac27-e52ec976da62.1, currentDir=/home/marcin/repo/spring-cloud-contract-samples}. Dispatching build started information...
14:00:13.315 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 83: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
...
14:00:13.317 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
14:00:13.318 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 21094). The daemon log file: /home/marcin/.gradle/daemon/3.5/daemon-21094.out.log
14:00:13.318 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting 11th build in daemon [uptime: 2 hrs 12 mins 4.361 secs, performance: 98%, no major garbage collections]
14:00:13.320 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
14:00:13.321 [INFO] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=3507aa41-27ae-42b5-b7b5-d9f509405d15,javaHome=/home/marcin/.sdkman/candidates/java/8u111,daemonRegistryDir=/home/marcin/.gradle/daemon,pid=21094,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
14:00:13.322 [INFO] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for plugin-use-metadata, path /home/marcin/.gradle/caches/3.5/plugin-resolution/plugin-use-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@48580cec
14:00:13.322 [INFO] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for client-status, path /home/marcin/.gradle/caches/3.5/plugin-resolution/client-status.bin, access org.gradle.cache.internal.DefaultCacheAccess@48580cec
:removeHtml
:asciidoctor
----- End of the daemon log -----

* Exception is:
org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
        at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:227)
        at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:203)
        at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:167)
        at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:130)
        at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:81)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:281)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:254)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:247)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:182)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

I’m building this project - https://github.com/spring-cloud-samples/spring-cloud-contract-samples


(William Lichtenberger) #2

Hi @Marcin_Grzejszczak,

Any tips for reproducing this issue? I’ve run ./gradlew generateDocumentation dozens of times and haven’t seen an issue. Could you share the output of ./gradlew --version?

Also, would you try running with Gradle 3.4.1 to see if the problem only happens to you with that version?

Thanks!


(Marcin Grzejszczak) #3

That’s the problem - there’s nothing else I can suggest you do :wink:

I’ve ran ./gradlew --version

------------------------------------------------------------
Gradle 3.5
------------------------------------------------------------

Build time:   2017-04-10 13:37:25 UTC
Revision:     b762622a185d59ce0cfc9cbc6ab5dd22469e18a6

Groovy:       2.4.10
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_111 (Oracle Corporation 25.111-b14)
OS:           Linux 4.10.0-041000-generic amd64

I’ll try to play around with 3.4.1 and I’ll get back to you


(William Lichtenberger) #4

@Marcin_Grzejszczak,

If you have access to another machine (or even a VM or container on the same machine), I’d also like to know if you see the same behavior. I don’t know how readily reproducible the problem is for you.


(Marcin Grzejszczak) #5

I had the same problem on the same machine on another project so it’s not really project related I guess :confused:


(William Lichtenberger) #6

Was that project using the same version of Gradle?


(Marcin Grzejszczak) #7

Hi! Sorry for the delay. Recently I stopped seeing this issue so maybe that was sth wrong with my laptop. Let’s close this issue.


(Abdul Mueed) #8

Hi, I have linux server on AWS EC2 instance, which runs gradle generates APK and sends it to related client…
Recently after updating to gradle 3.5… i am having this issue I have tried many things

Including having daemon as false in gradle.properties
org.gradle.jvmargs=-Xmx1536M
org.gradle.daemon=false

tried to run ./gradlew --no-daemon build

tried to increase =-Xmx1536M to =-Xmx2048m

but nothing helps… I keep getting same error, the stacktrace says

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

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

* Exception is:
org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
        at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:227)
        at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:203)
        at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:167)
        at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:56)
        at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:38)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:281)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:254)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:247)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:182)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)