Jenkins build failure,Gradle build daemon disappeared unexpectedly
Asked Answered
A

3

8

My CI Server configuration is low.

If I use the gradle daemon to build project,It throw a error:

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

Then, If I use the gradle-2.14.1 that default close gradle daemon,my task 'publish' is BUILD SUCCESS, but it will append other task to close daemon that BUILD FAILURE.

The message received from the daemon indicates that the daemon has disappeared
FAILURE: Build failed with an exception.

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

Of course,if I run the gradle at my macbookpro, everything is OK.

I found the other way to solve the problem, run gradle --stop, then run gradle <task>. But it just work for simple task.

So, how to solve this problem?

Aurelioaurelius answered 16/12, 2016 at 14:39 Comment(1)
The daemon is not intended for use on CI servers. There is a warning about that when you use it.Haynes
K
3

Adding the flag -Dorg.gradle.daemon=false to the GRADLE_OPTS environment variable solved my issue in my case. Details can be found at : https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:ways_to_disable_gradle_daemon

Koger answered 19/6, 2018 at 19:31 Comment(0)
R
2

It is recommended to turn off gradle daemon on any CI server.

use this option to disable it

--no-daemon

https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon

Rumania answered 22/8, 2017 at 14:0 Comment(2)
This appears not to be the case any longer - github.com/gradle/gradle/issues/2824Heydon
I've just run into this very same issue because of the CI task's container run out of memory. Nothing to do with the daemon itself.Notable
V
0

Just discovered the following Jenkins Plugin: https://plugins.jenkins.io/gradle-daemon/ and with the plugin installed, the Daemon is not killed after the build, if it is still in use.

Vizor answered 12/1, 2022 at 11:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.