Gradle daemon should not get killed unexpectedly.
The Gradle daemon just crashes. If the environment variables have Japanese and/or space. Though I dont know why env var are listed in logs of gradle build after Build Started is called.
This is only reproducible in my Jenkins environment with is compiling app on docker image. I cannot get to reproduce it because I cannot understand how to do the same on local machine. But logs are pretty clear and I think I have a solution.
The build keeps failing consistently and always after setting the Environment variables. So I tried removing the environment variables with Japanese characters or multiline string and this fixes. If I do the same on local machine, the environment variables don't get injected in the Gradle build process. Or at least they are not displayed in logs. If you can tell me why this happens on Jenkins/ubuntu/docker then perhaps I can reproduce this on local machine.
[xxx-android] Running shell script
+ ./gradlew --no-daemon clean testDebug assembleDebug
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.5/userguide/gradle_daemon.html.
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android}
Attempting to read last messages from the daemon log...
Daemon pid: 116
log file: /root/.gradle/daemon/3.5/daemon-116.out.log
----- Last 20 lines from daemon log file - daemon-116.out.log -----
08:52:19.473 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
08:52:19.473 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
08:52:19.488 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Accepted connection from /0:0:0:0:0:0:0:1:34394 to /0:0:0:0:0:0:0:1:35585.
08:52:19.558 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 16: received class org.gradle.launcher.daemon.protocol.BuildAndStop
08:52:19.558 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 16: Received non-IO message from client: BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android}
08:52:19.558 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android}.
08:52:19.559 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android} with connection: socket connection from /0:0:0:0:0:0:0:1:35585 to /0:0:0:0:0:0:0:1:34394.
08:52:19.561 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android}, connection = DefaultDaemonConnection: socket connection from /0:0:0:0:0:0:0:1:35585 to /0:0:0:0:0:0:0:1:34394] after 0.0 minutes of idle
08:52:19.561 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [0389df00-f5ac-4dc0-a699-bcceef8445e1 port:35585, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
08:52:19.561 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [0389df00-f5ac-4dc0-a699-bcceef8445e1 port:35585, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
08:52:19.562 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
08:52:19.562 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
08:52:19.563 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
08:52:19.563 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
08:52:19.564 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
08:52:19.564 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building BuildAndStop{id=3c56957a-a7c7-4672-b6ba-9898b0f71604.1, currentDir=/var/jenkins_home/workspace/xxx-android}. Dispatching build started information...
08:52:19.564 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 18: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
08:52:19.569 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tools:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools, RUN_DISPLAY_URL=http://10.48.56.47:8090/job/xxx-android/210/display/redirect, HUDSON_HOME=/var/jenkins_home, RUN_CHANGES_DISPLAY_URL=http://10.48.56.47:8090/job/xxx-android/210/display/redirect?page=changes, JOB_URL=http://10.48.56.47:8090/job/xxx-android/, JAVA8_HOME=/usr/lib/jvm/java-8-oracle, QA_SERVER=10.48.57.222:8181, XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt, BUILD_ID=210, JENKINS_NODE_COOKIE=37cf1e80-8206-4a85-bc73-5b2415582a85, JOB_NAME=xxx-android, ANDROID_HOME=/opt/android-sdk-linux, HOCKEY_SERVER_ENDPOINT=https://xxx, NOTES=xxx-2312 娉ㄦ枃瑭崇窗 link on purchase history screen transit to shop inquiry page
Merge pull request #739 in SDD/xxx-android-app from fix_auto_factory_gradle to qa
Fix inconsistent auto factory version in gradle script, LASTEST_TAG=v5.1.0-QA-2017-10-05-18-21, COMMIT_ID=2da6af29adafdf8f2e8d6e3a2a166218e48c64c7, NODE_LABELS=master, HUDSON_URL=http://10.48.56.47:8090/, JENKINS_SERVER_COOKIE=durable-1cd26ce513bf31908fc40de203b8c04e, WORKSPACE=/var/jenkins_home/workspace/xxx-android, PWD=/var/jenkins_home/workspace/xxx-android, JENKINS_URL=http://10.48.56.47:8090/, BUILD_TAG=jenkins-xxx-android-210, JAVA7_HOME=/usr/lib/jvm/java-7-oracle, EXECUTOR_NUMBER=1, HUDSON_SERVER_COOKIE=da1b63e92433d92d, JOB_BASE_NAME=xxx-android, OLDPWD=/var/jenkins_home/workspace/xxx-android, CLASSPATH=/var/jenkins_home/workspace/xxx-android/gradle/wrapper/gradle-wrapper.jar, BUILD_NUMBER=210, NODE_NAME=master, DEBIAN_FRONTEND=noninteractive, BUILD_DISPLAY_NAME=#210, HOSTNAME=e8931efb81a6, BUILD_URL=http://10.48.56.47:8090/job/xxx-android/210/, JIRA_AUTH_KEY=xxxx, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, JOB_DISPLAY_URL=http://10.48.56.47:8090/job/xxx-android/display/redirect, BRANCH_NAME=origin/fix/AIPB-2312, HOME=/root, SHLVL=0}
----- 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)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Jenkins with Docker. I am using Jenkinsfile with Declarative syntax.
Thanks for reporting. Notice the message To honour the JVM settings for this build a new JVM will be forked.
in your logs. Do you see this locally as well? What about when you omit the --no-daemon
flag in your local build?
I suspect something different in the file encoding or language setting for your local and Jenkins environment. In order to reproduce, I'd investigate those settings.
I'm closing this issue as there's no action we can take. Please understand that we receive lots of issues and need to focus on the ones that are actionable. Here are some ways to make your issue actionable, in order of preference:
-Dorg.gradle.debug=true
and attach a remote debugger to dig into the Gradle code base. That way you might find the problematic code and we might be able to come up with a unit test.Can confirm this. Our builds were failing in a similar fashion and unsetting the only environment variable that had some simple characters with accents solved the issue.
In our specific case Gitlab started to include user names during CI builds in environment variables like this:
GITLAB_USER_NAME=Andr谩s Bald贸
Which produced some suspicious log entries:
[org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: { ......
GITLAB_USER_NAME=Andr??s Bald?? ......}
I think this happens whenever Gradle decides to fork and environment variables with UTF-8 character values are present. It is really hard to determine the exact point of crash as absolutely nothing is mentioned about in any of the logs (nor are any hs_err_pid_*.log files are present).
I just want to know why this "EstablishBuildEnvironment" log does not appear on local environment. And perhaps how can I produce it.
I ran into the same issue with gitlab and docker (ubuntu based image).
Adding unicode support to the docker image fixed it.
RUN apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
OK I'm reopening this as it's clearly affecting a number of users.
@socketbind Are you running Gradle in a Docker container? If not, can you provide instructions for us to reproduce the failure (without Docker)?
@blindpirate I'll move this to the icebox, since I don't have capacity to investigate further. If you get an opportunity it would be great to reproduce this issue (and I'm sure you have experience with non-ASCII characters!)
I have the same problem on my GitLab CI with a non-ascii username.
Any progress on this? Any way to get builds working for those users?
The fix from @inv3rse (adding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
to the DOCKERFILE of the used image) does not help 馃槩.
There's an error in the log when adding this fix:
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
I've also tried disabling the gradle-daemon by adding the flag -Dorg.gradle.daemon=false
to the GRADLE_OPTS
environment variable but this does not help either.
@hardysim Thanks for reporting, I'd like you to provide more information:
That would help. Thanks a lot.
This looks very much like a locale issue to me.
@JehandadK @socketbind @inv3rse Could you provide some more information about this crash?
I'd appreciate these information, thank you.
I was able to workaround this by improving the fix from @inv3rse. I've added the following to my Dockerfile
which solves my problem:
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.UTF-8
@blindpirate my CI is the GitLab CI Runner using my docker-image from https://gitlab.com/hardysim/android-ci. The username contains a german umlaut 盲
wich caused the problem.
I didn't test it locally because there's no such environment variable and a different user (I could set this up of course but as the workaround fixes the problem for me I'd like to save some time 馃槈).
I've just come across the same issue.
I'm using
root@c65adb928ce2:~# ./gradlew -v
------------------------------------------------------------
Gradle 3.3
------------------------------------------------------------
Build time: 2017-01-03 15:31:04 UTC
Revision: 075893a3d0798c0c1f322899b41ceca82e4e134b
Groovy: 2.4.7
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Linux 3.13.0-45-generic amd64
And yes, I can reproduce it locally with the same docker image. The character I tried with is 啪
, and gradle crashes if I set whichever environment variable to contain this character.
@zitnik maybe my updated docker-image can help you:
image: registry.gitlab.com/hardysim/android-ci:latest
@zitnik @hardysim Thank you very much, now I could reproduce it:
In whichever gradle-build proejct, run
docker run -e A=啪 -v `pwd`:`pwd` jangrewe/gitlab-ci-android `pwd`/gradlew <taskName>
We'll try to fix it soon.
Confirmed on gradle 4.7: we get the crash from gitlab CI on every commit with french characters ("茅脿...") in CI_COMMIT_DESCRIPTION env variable
Hey!
We are affected as well. The issue happens on Ubuntu 18.04 even if we set locale to en-US.UTF-8 like here: https://github.com/mindrunner/docker-android-sdk/pull/25
For example:
export TEST="馃"
git clone https://github.com/trapacska/intro_android_demo.git proj
cd proj
./gradlew -i dependencies
This is the log right before the sigsev: https://github.com/gradle/gradle/blob/master/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/exec/EstablishBuildEnvironment.java#L65
Is there any workaround so far? @blindpirate ?
Thanks in advance!
For me the the hint regarding locale configuration fixed it for me, using this Dockerfile should work:
FROM ubuntu:bionic
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && apt-get update -qq && apt-get upgrade -y && apt-get install -y software-properties-common curl wget zip unzip tzdata locales openjdk-8-jdk && locale-gen en_US.UTF-8 de_DE.UTF-8 && update-locale LANG=de_DE.UTF-8
ENV LANG='de_DE.UTF-8' LANGUAGE='de_DE:en' LC_ALL='de_DE.UTF-8' JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
ARG GRADLE_VERSION=4.9
RUN cd /opt && wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && unzip gradle-${GRADLE_VERSION}-bin.zip && rm -f gradle-${GRADLE_VERSION}-bin.zip && ln -s /opt/gradle-${GRADLE_VERSION}/bin/gradle /usr/local/bin/gradle
(I'm German so I prefer de_DE and Europe/Berlin since I'm already touching the locale config.)
Hm.. Thanks @p-schneider ! Actually it is fixing /usr/bin/gradle only, however gradle wrapper(gradlew) still have the same issue. Is there anyone who encountered the same issue?
@trapacska I've posted a workaround. You need to set the locale.
See https://github.com/gradle/gradle/issues/3117#issuecomment-351376178
For people not using docker, here is the workaround:
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
export LANG=en_EN.UTF-8
Thanks @ofaurax & @hardysim !
Dockerfile:
FROM ubuntu:18.04
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get upgrade && apt-get install -y --no-install-recommends apt-utils
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-8-jdk libc6:i386 libstdc++6:i386 libgcc1:i386 libncurses5:i386 libz1:i386 wget unzip git
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.UTF-8
ENV ANDROID_HOME /opt/android-sdk-linux
RUN cd /opt \
&& wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O android-sdk-tools.zip \
&& unzip -q android-sdk-tools.zip -d ${ANDROID_HOME} \
&& rm android-sdk-tools.zip
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager --licenses
RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;25.0.2"
RUN git clone https://github.com/trapacska/intro_android_demo.git proj && cd proj && TEST="馃" ./gradlew -i dependencies
Same error:
Downloading https://services.gradle.org/distributions/gradle-3.3-all.zip
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3-all.zip to /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3/bin/gradle
Initialized native services in: /root/.gradle/native
Removing 0 daemon stop events from registry
Starting a Gradle Daemon (subsequent builds will be faster)
Starting daemon process: workingDir = /root/.gradle/daemon/3.3, daemonArgs: [/usr/lib/jvm/java-8-openjdk-amd64/bin/java, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -cp, /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3/lib/gradle-launcher-3.3.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 3.3]
Starting process 'Gradle build daemon'. Working directory: /root/.gradle/daemon/3.3 Command: /usr/lib/jvm/java-8-openjdk-amd64/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /root/.gradle/wrapper/dists/gradle-3.3-all/2n0i7hqatcbtk57vvql575dbap/gradle-3.3/lib/gradle-launcher-3.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 3.3
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 0.912 secs.
Connected to daemon DaemonInfo{pid=45, address=[48ce2503-0195-4612-8698-70421948fe13 port:33919, addresses:[/127.0.0.1]], state=Busy, lastBusy=1531918461997, context=DefaultDaemonContext[uid=e7afc6f8-7251-495f-a0d4-dfa61a7da878,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/root/.gradle/daemon,pid=45,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}.
Received result org.gradle.launcher.daemon.protocol.BuildStarted@4c9cce17 from daemon DaemonInfo{pid=45, address=[48ce2503-0195-4612-8698-70421948fe13 port:33919, addresses:[/127.0.0.1]], state=Busy, lastBusy=1531918461997, context=DefaultDaemonContext[uid=e7afc6f8-7251-495f-a0d4-dfa61a7da878,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/root/.gradle/daemon,pid=45,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be starting).
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}
Attempting to read last messages from the daemon log...
Daemon pid: 45
log file: /root/.gradle/daemon/3.3/daemon-45.out.log
----- Last 20 lines from daemon log file - daemon-45.out.log -----
12:54:22.135 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
12:54:22.138 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
12:54:22.139 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
12:54:22.230 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 13: received class org.gradle.launcher.daemon.protocol.Build
12:54:22.231 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 13: Received non-IO message from client: Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}
12:54:22.231 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}.
12:54:22.231 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj} with connection: socket connection from /127.0.0.1:33919 to /127.0.0.1:54070.
12:54:22.234 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}, connection = DefaultDaemonConnection: socket connection from /127.0.0.1:33919 to /127.0.0.1:54070] after 0.0 minutes of idle
12:54:22.235 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [48ce2503-0195-4612-8698-70421948fe13 port:33919, addresses:[/127.0.0.1]]
12:54:22.236 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [48ce2503-0195-4612-8698-70421948fe13 port:33919, addresses:[/127.0.0.1]]
12:54:22.237 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
12:54:22.237 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
12:54:22.239 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
12:54:22.239 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
12:54:22.239 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
12:54:22.240 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=6430b774-bce4-49e9-89ca-64d02e75f3f5.1, currentDir=/proj}. Dispatching build started information...
12:54:22.241 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 16: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
12:54:22.255 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 13: received class org.gradle.launcher.daemon.protocol.CloseInput
12:54:22.255 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 13: Received IO message from client: org.gradle.launcher.daemon.protocol.CloseInput@61637a08
12:54:22.256 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/platform-tools, HOSTNAME=ec81a79c2337, TEST=馃, OLDPWD=/proj, PWD=/proj, LANG=en_US.UTF-8, SHLVL=0, HOME=/root, ANDROID_HOME=/opt/android-sdk-linux}
----- 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)
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
Any idea?
I don't know docker, but perhaps each "RUN" is in a separate context.
Try: ... && env LANG=en_US.UTF-8 TEST="馃" ./gradlew -i dependencies
I think the main issue with setting LANG env is that the daemon crashes at a point when it wants to set the envs. (So failing in the process of getting the envs to be able to pick up the LANG env.)
@ofaurax If you see the last line of daemon log
12:54:22.256 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/platform-tools, HOSTNAME=ec81a79c2337, TEST=馃, OLDPWD=/proj, PWD=/proj, LANG=en_US.UTF-8, SHLVL=0, HOME=/root, ANDROID_HOME=/opt/android-sdk-linux}
there is the LANG=en_US.UTF-8
as well. So I think it is picked up correctly. However gradlew can't read it because it fails to read envs. 馃檨
Locally (neither using Docker or Jenkins) I have the same problem... Setting the LANG
environment variable to en_US.UTF-8
do not fix the problem. The only solution I found for the moment is to unset most of my environment variables:
exec env -i HOME="$HOME" TERM="$TERM" PATH="$PATH" zsh -f
./gradlew
I've found that on recent versions on Ubuntu (i.e. 18.04) and Debian (i.e. stretch) the localedef
workaround don't fix the issue if the environment contains characters outside the Basic Multilingual Plane (e.g. emojis). As such, the following will reproduce the issue:
$ docker build -t gradle-unicode - <<EOF
FROM buildpack-deps:stretch
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
openjdk-8-jdk-headless \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.UTF-8
ENV TEST 馃挜
RUN set -x \
&& cd /opt \
&& curl -OL https://services.gradle.org/distributions/gradle-4.10.2-bin.zip \
&& unzip gradle-4.10.2-bin.zip \
&& rm gradle-4.10.2-bin.zip
CMD ["/opt/gradle-4.10.2/bin/gradle", ":help"]
EOF
$ docker run --rm gradle-unicode
[snip]
FAILURE: Build failed with an exception.
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
Note that a non-ASCII character in the Basic Multilingual Plane works:
# FFEE HALFWIDTH WHITE CIRCLE
$ docker run --rm -e TEST=$'\xef\xbf\xbf' gradle-unicode
[snip]
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
While a character in the Supplementary Multilingual Plane fails:
# 10000 LINEAR B SYLLABLE B008 A
$ docker run --rm -e TEST=$'\xf0\x90\x80\x80' gradle-unicode
[snip]
FAILURE: Build failed with an exception.
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
The same holds true for the official Docker image:
$ docker run --rm -e TEST=$'\xef\xbf\xbf' gradle gradle :help
[snip]
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
$ docker run --rm -e TEST=$'\xf0\x90\x80\x80' gradle gradle :help
[snip]
FAILURE: Build failed with an exception.
* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
```
$ docker run --rm -e TEST=馃挜 gradle gradle :help
[snip]
FAILURE: Build failed with an exception.
I'm affected by this issue since using a freshly installed machine. The character causing the problem is the unicode key 馃攽. What is weird is that I did not have the problem on my previous machine, whereas they use the following similar versions:
< java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
<./gradlew --version
------------------------------------------------------------
Gradle 4.8
------------------------------------------------------------
Build time: 2018-06-04 10:39:58 UTC
Revision: 9e1261240e412cbf61a5e3a5ab734f232b2f887d
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_162 (Oracle Corporation 25.162-b12)
OS: Linux 4.15.0-39-generic amd64
The problem only happens when using a daemon. Passing --no-daemon circumvents the issue. On the machine with the problem (Ubuntu 18.04), the LC/LANG variables are as follows:
< export | grep "LC\|LANG"
declare -x LANG="en_US.UTF-8"
declare -x LC_ADDRESS="fr_FR.UTF-8"
declare -x LC_IDENTIFICATION="fr_FR.UTF-8"
declare -x LC_MEASUREMENT="fr_FR.UTF-8"
declare -x LC_MONETARY="fr_FR.UTF-8"
declare -x LC_NAME="fr_FR.UTF-8"
declare -x LC_NUMERIC="fr_FR.UTF-8"
declare -x LC_PAPER="fr_FR.UTF-8"
declare -x LC_TELEPHONE="fr_FR.UTF-8"
declare -x LC_TIME="fr_FR.UTF-8"
while on the working machine (Ubuntu 16.04), they are as follows:
< export | grep "LANG\|LC"
declare -x GDM_LANG="en_US"
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US"
declare -x LC_ADDRESS="fr_FR.UTF-8"
declare -x LC_IDENTIFICATION="fr_FR.UTF-8"
declare -x LC_MEASUREMENT="fr_FR.UTF-8"
declare -x LC_MONETARY="fr_FR.UTF-8"
declare -x LC_NAME="fr_FR.UTF-8"
declare -x LC_NUMERIC="fr_FR.UTF-8"
declare -x LC_PAPER="fr_FR.UTF-8"
declare -x LC_TELEPHONE="fr_FR.UTF-8"
declare -x LC_TIME="fr_FR.UTF-8"
The last line of the log before crashing is [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables:
Running into the same issue with Jenkins and GitHub, where PR description text is injected into our builds environment variables. This causes failures when using emojis inside GH pull request descriptions.
@davidschreiber same problem here
Solved in alpine
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV GLIBC_VERSION "2.28-r0"
RUN curl -s https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub \
&& curl -sL https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk -o glibc.apk \
&& curl -sL https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk -o glibc-bin.apk \
&& curl -sL https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-i18n-${GLIBC_VERSION}.apk -o glibc-i18n.apk \
&& apk add glibc-bin.apk glibc.apk glibc-i18n.apk \
&& /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& rm -rf glibc.apk glibc-bin.apk glibc-i18n.apk
Add this snipet to Dockerfile
For some reason, I think that build-base package, or some of its transitive packages, was causing this behavior on the Alpine image.
After installing only needed packages (make
, g++
and ruby-dev
) to build Fastlane, and after uninstalling them, solved the problem for me.
Before:
RUN apk --update add --no-cache build-base ruby ruby-dev \
&& gem install fastlane -N
After:
RUN apk add --virtual build-dependencies make g++ ruby-dev \
&& apk add --update --no-cache ruby \
&& gem install fastlane -N \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/*
Environment
3.8
)8u192
)2.28-r0
)4.10.2
)Looks like we're hitting the same issue running gradle daemon on Cirrus (https://github.com/flutter/flutter/issues/24935)
e.g in this instance the 馃憤 emoji in the PR description which ended up in an environment variable seems to make gradle crash:
* Error running Gradle:
ProcessException: Process "/tmp/cirrus-ci-build/packages/webview_flutter/example/android/gradlew" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android}
Attempting to read last messages from the daemon log...
Daemon pid: 752
log file: /home/cirrus/.gradle/daemon/4.10.2/daemon-752.out.log
----- Last 20 lines from daemon log file - daemon-752.out.log -----
23:37:06.178 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 15: Received non-IO message from client: Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android}
23:37:06.178 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android}.
23:37:06.178 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android} with connection: socket connection from /0:0:0:0:0:0:0:1:37557 to /0:0:0:0:0:0:0:1:60800.
23:37:06.181 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android}, connection = DefaultDaemonConnection: socket connection from /0:0:0:0:0:0:0:1:37557 to /0:0:0:0:0:0:0:1:60800] after 0.0 minutes of idle
23:37:06.182 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [74513f3f-8c53-433c-bce6-402a0220131c port:37557, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
23:37:06.182 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [74513f3f-8c53-433c-bce6-402a0220131c port:37557, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
23:37:06.182 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
23:37:06.183 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
23:37:06.184 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
23:37:06.185 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
23:37:06.185 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
23:37:06.186 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=58675e8f-41c0-4a15-af6f-5123e1360583, currentDir=/tmp/cirrus-ci-build/packages/webview_flutter/example/android}. Dispatching build started information...
23:37:06.186 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 17: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
23:37:06.188 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/platform-tools:/home/cirrus/sdks/flutter/bin:/home/cirrus/sdks/flutter/bin/cache/dart-sdk/bin, CIRRUS_WORKING_DIR=/tmp/cirrus-ci-build, CIRRUS_BASE_BRANCH=master, CIRRUS_TASK_NAME=build-apks+java-test, ANDROID_HOME=/opt/android-sdk-linux, CIRRUS_USER_COLLABORATOR=true, CIRRUS_DEFAULT_BRANCH=master, PWD=/tmp/cirrus-ci-build/packages/webview_flutter/example/android, CIRRUS_REPO_NAME=plugins, CIRRUS_OS=linux, LANGUAGE=en_US:en, KUBERNETES_PORT_443_TCP=tcp://10.11.240.1:443, OLDPWD=/tmp/cirrus-ci-build/packages/webview_flutter/example/android, ANDROID_PLATFORM_VERSION=28, PLUGIN_SHARDING=--shardIndex 0 --shardCount 2, CI_NODE_TOTAL=7, ANDROID_BUILD_TOOLS_VERSION=28.0.3, CONTINUOUS_INTEGRATION=true, JAVA_DEBIAN_VERSION=8u181-b13-2~deb9u1, CIRRUS_REPO_CLONE_URL=https://github.com/flutter/plugins.git, LC_ALL=en_US.UTF-8, CIRRUS_REPO_FULL_NAME=flutter/plugins, CIRRUS_REPO_OWNER=flutter, KUBERNETES_SERVICE_PORT_HTTPS=443, SHLVL=3, FLUTTER_VERSION=1.0.0, CIRRUS_COMMIT_MESSAGE=Implemented reload method in webview_flutter
As the title says, I added a reload method in webview_flutter. Fixes https://github.com/flutter/flutter/issues/25099 馃憤 , CIRRUS_TASK_ID=5708594550931456, KUBERNETES_PORT=tcp://10.11.240.1:443, JAVA_HOME=/docker-java-home, ANDROID_SDK_TOOLS_VERSION=4333796, CIRRUS_BUILD_ID=5956204566151168, CA_CERTIFICATES_JAVA_VERSION=20170531+nmu1, TERM=xterm-256color, FLUTTER_ROOT=/home/cirrus/sdks/flutter, FLUTTER_HOME=/home/cirrus/sdks/flutter, KUBERNETES_SERVICE_HOST=10.11.240.1, LANG=en_US.UTF-8, CIRRUS_CHANGE_IN_REPO=caa2d950ae918c6c0a29915c1e323e4548785ba2, CIRRUS_BRANCH=pull/974, JAVA_VERSION=8u181, CIRRUS_USER_PERMISSION=write, CI_NODE_INDEX=3, BRANCH=pull/974, CIRRUS_CI=true, KUBERNETES_PORT_443_TCP_ADDR=10.11.240.1, OS=linux, CI=true, CIRRUS_HTTP_CACHE_HOST=127.0.0.1:12321, KUBERNETES_PORT_443_TCP_PROTO=tcp, CIRRUS_CHANGE_MESSAGE=Implemented reload method in webview_flutter
As the title says, I added a reload method in webview_flutter. Fixes https://github.com/flutter/flutter/issues/25099 馃憤 , KUBERNETES_SERVICE_PORT=443, HOSTNAME=cirrus-ci-task-5708594550931456-dvqst, CIRRUS_BASE_SHA=94f6577f4c9649acabeaca311028d0430a7bd8b7, CIRRUS_REPO_CLONE_HOST=github.com, KUBERNETES_PORT_443_TCP_PORT=443, CIRRUS_PR=974, HOME=/home/cirrus}
23:37:06.190 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 15: received class org.gradle.launcher.daemon.protocol.CloseInput
23:37:06.190 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 15: Received IO message from client: org.gradle.launcher.daemon.protocol.CloseInput@627fe142
----- 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)
Thank you very much for reporting this.
I was clueless about why cordova build android
was failing due to a gradle error.
The problem was caused by having an emoji inside my PS1 bash prompt!
I guess I would never find that out if I wouldn't stumble upon this report.
@davidschreiber so you're using the WIP app too, eh? And thanks @miguelslemos, we'll have to give that a try.
@schroedingerscode not sure what WIP app is?
The issue with the daemon crashing when there are supplementary characters (e.g. emojis and the like) in environment variables should be fixed now on current master (to be version 5.3). Gradle should just handle this seamlessly now, and even if it doesn't for some reason, it should produce a clean and descriptive error (rather than crashing).
It would be great if folks who have experienced the issue could try out one of the latest nightlies and validate that this does indeed resolve the problem for them.
Tested it this morning. Seems to be fixed !!!!!
Old gradle version output (click to expand)
$ ./gradlew --version
------------------------------------------------------------
Gradle 4.10
------------------------------------------------------------
Build time: 2018-08-27 18:35:06 UTC
Revision: ee3751ed9f2034effc1f0072c2b2ee74b5dce67d
Kotlin DSL: 1.0-rc-3
Kotlin: 1.2.60
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_202 (Oracle Corporation 25.202-b26)
OS: Linux 4.20.7-arch1-1-ARCH amd64
$ ./gradlew tasks
Starting a Gradle Daemon (subsequent builds will be faster)
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=87e2e675-5378-481c-ba5e-54e74917dca2, currentDir=[...]}
Attempting to read last messages from the daemon log...
Daemon pid: 6992
log file: /home/alexis/.gradle/daemon/4.10/daemon-6992.out.log
----- Last 20 lines from daemon log file - daemon-6992.out.log -----
is_a_git_repo:1
separator:2
has_stashes:6
has_untracked:7
has_workspace_mods:11
has_workspace_dels:12
has_index_mods:16
has_index_moves:17
has_index_adds:18
has_index_dels:19
ready_to_commit:21
has_pending_action:22
detached:26
not_tracked:27
has_diverged:31
can_ff:32
should_push:33
rebase_tracking:36
merge_tracking:37
tag:41, HISTFILE=/home/alexis//.cache/shell/history, On_Black=\e[48;5;0m, LANG=fr_FR.UTF-8, XDG_SESSION_TYPE=x11, DISPLAY=:0.0, v_prompt_alexis_py_line=, GCC_ARM_TOOLCHAIN=/usr/arm-none-eabi/, PYTHONSTARTUP=/home/alexis//.pythonrc.py, GBG_VERSION=0.0.10, LSCOLORS=Gxfxcxdxbxegedabagacad, TERMINATOR_DBUS_NAME=net.tenshu.Terminator20x1a6021154d881c, ANDROID_SDK_ROOT=/opt/android-sdk/, USER=alexis, BRed=\e[38;5;9m, TERMINATOR_UUID=urn:uuid:f0989691-770c-4299-b84d-0406ccc96b52, XDG_SEAT=seat0, SSH_AUTH_SOCK=/run/user/1000/keyring/ssh, EDITOR=vim, White=\e[38;5;7m, GBG_DIR=/home/alexis/Personal/Projects/shell/god-bless-git, Purple=\e[38;5;5m, XDG_RUNTIME_DIR=/run/user/1000, XDG_VTNR=7, Green=\e[38;5;2m, HOME=/home/alexis/}
----- 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)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
New gradle version output (click to expand)
$ ./gradlew --version
------------------------------------------------------------
Gradle 5.3-20190219072348+0000
------------------------------------------------------------
Build time: 2019-02-19 07:23:48 UTC
Revision: aa05b36a7f876974519383502b620dbbb4b9747c
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_202 (Oracle Corporation 25.202-b26)
OS: Linux 4.20.7-arch1-1-ARCH amd64
$ ./gradlew tasks
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------
[...]
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
In wich release this will be live ?
5.3, there's a release candidate out for it now: https://docs.gradle.org/5.3-rc-3/release-notes.html
This does not seems to be fixed completely. Still having this issue in gradle (wrapper) 5.6.3
Versions
------------------------------------------------------------
Gradle 5.6.3
------------------------------------------------------------
Build time: 2019-10-18 00:28:36 UTC
Revision: bd168bbf5d152c479186a897f2cea494b7875d13
Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 1.8.0_222 (Private Build 25.222-b10)
OS: Linux 4.15.0-1032-aws amd64
ubuntu@ip-172-31-39-13:~/fineract-ng$ docker --version
Docker version 18.06.1-ce, build e68fc7a
Gradle log
./gradlew clean build docker -x test
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/5.6.3/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=d12df184-a06c-491c-a0fb-450c6fa8ba1b, currentDir=/home/ubuntu/fineract-ng}
Attempting to read last messages from the daemon log...
Daemon pid: 13791
log file: /home/ubuntu/.gradle/daemon/5.6.3/daemon-13791.out.log
----- Last 20 lines from daemon log file - daemon-13791.out.log -----
14:36:09.488 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=d12df184-a06c-491c-a0fb-450c6fa8ba1b, currentDir=/home/ubuntu/fineract-ng} with connection: socket connection from /0:0:0:0:0:0:0:1:34381 to /0:0:0:0:0:0:0:1:55090.
14:36:09.495 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=d12df184-a06c-491c-a0fb-450c6fa8ba1b, currentDir=/home/ubuntu/fineract-ng}, connection = DefaultDaemonConnection: socket connection from /0:0:0:0:0:0:0:1:34381 to /0:0:0:0:0:0:0:1:55090] after 0.0 minutes of idle
14:36:09.496 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [f85d69dd-fc40-4c59-81ed-6e6bf6287726 port:34381, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
14:36:09.496 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [f85d69dd-fc40-4c59-81ed-6e6bf6287726 port:34381, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
14:36:09.496 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
14:36:09.497 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
14:36:09.499 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
14:36:09.500 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
14:36:09.506 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
14:36:09.506 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=d12df184-a06c-491c-a0fb-450c6fa8ba1b, currentDir=/home/ubuntu/fineract-ng}. Dispatching build started information...
14:36:09.507 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 17: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
14:36:09.510 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin, LESSCLOSE=/usr/bin/lesspipe %s %s, SHELL=/bin/bash, LESSOPEN=| /usr/bin/lesspipe %s, XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop, SSH_TTY=/dev/pts/0, SSH_CLIENT=181.166.230.204 59319 22, TERM=xterm, OLDPWD=/home/ubuntu/fineract-ng, USER=ubuntu, LANG=C.UTF-8, XDG_SESSION_ID=1, SSH_CONNECTION=181.166.230.204 59319 172.31.39.13 22, MAIL=/var/mail/ubuntu, LOGNAME=ubuntu, PWD=/home/ubuntu/fineract-ng, LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:, XDG_RUNTIME_DIR=/run/user/1000, HOME=/home/ubuntu, SHLVL=1, _=./gradlew}
14:36:09.515 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
14:36:09.516 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 13791). The daemon log file: /home/ubuntu/.gradle/daemon/5.6.3/daemon-13791.out.log
14:36:09.519 [DEBUG] [org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon] Requesting daemon stop after processing Build{id=d12df184-a06c-491c-a0fb-450c6fa8ba1b, currentDir=/home/ubuntu/fineract-ng}
14:36:09.519 [LIFECYCLE] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon will be stopped at the end of the build stopping after processing
14:36:09.519 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Stop as soon as idle requested. The daemon is busy: true
14:36:09.520 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon stop has been requested. Sleeping until state changes.
14:36:09.524 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
14:36:09.525 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=306ba55b-6113-45d5-9e09-701e6549326e,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/ubuntu/.gradle/daemon,pid=13791,idleTimeout=120000,priority=NORMAL,daemonOpts=-Xmx4g,-Dfile.encoding=UTF-8,-Duser.country,-Duser.language=en,-Duser.variant]
----- 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)
Workaround
Downgrade gradlew to 5.3 (in which this issue was already fixed !)
./gradlew wrapper --gradle-version=5.3
Most helpful comment
Can confirm this. Our builds were failing in a similar fashion and unsetting the only environment variable that had some simple characters with accents solved the issue.
In our specific case Gitlab started to include user names during CI builds in environment variables like this:
GITLAB_USER_NAME=Andr谩s Bald贸
Which produced some suspicious log entries:
I think this happens whenever Gradle decides to fork and environment variables with UTF-8 character values are present. It is really hard to determine the exact point of crash as absolutely nothing is mentioned about in any of the logs (nor are any hs_err_pid_*.log files are present).