Gradle build daemon dissapeared unexpectedly - due to image locales
This issue is based the following comments:
Problem
Building on android fails with following error:
Gradle build daemon dissapeared unexpectedly
According to following comment, this still happens in 2019.3.3f1
How to reproduce
I don't have a way to reproduce this right now I would really appreciate an example or the commands used to create the build or more specific details to confirm that suggested fix does resolve issue.
According to related issues, this happens when environment variables contain non-ASCII characters. Here's a snippet I may try somewhere:
docker run -e A=ž -v `pwd`:`pwd` gableroux/gitlab-ci-android bash -c '`find / -name gradlew` <some_gradle_task>'
2019.3.3f1-android
docker image
Details for skopeo --override-os linux inspect docker://gableroux/unity3d:2019.3.3f1-android | jq '.Labels'
{
"build-date": "2020-03-30T06:15:45+0000",
"com.gableroux.unity3d.build": "f1",
"com.gableroux.unity3d.download_url": "https://beta.unity3d.com/download/7ceaae5f7503/UnitySetup-2019.3.3f1",
"com.gableroux.unity3d.release_notes": "https://unity3d.com/unity/whats-new/2019.3.3f1",
"com.gableroux.unity3d.release_url": "https://beta.unity3d.com/download/7ceaae5f7503/public_download.html",
"com.gableroux.unity3d.sha1": "68d3c58e977e71cdd00bd0100fcd60c02762ec04",
"com.gableroux.unity3d.tag": "2019.3.3f1-android",
"com.gableroux.unity3d.version": "2019.3.3",
"com.gitlab.ci.build": "https://gitlab.com/gableroux/unity3d/builds/490245428",
"com.gitlab.ci.builder": "lebreton.gabriel@gmail.com",
"com.gitlab.ci.pipeline": "https://gitlab.com/gableroux/unity3d/pipelines/130900083",
"com.gitlab.ci.ref": "master",
"vcs-url": "https://gitlab.com/gableroux/unity3d"
}
skopeo --override-os linux inspect docker://gableroux/unity3d:2019.3.3f1-android | jq '.Digest'
"sha256:9bde0aad9319103c3b2020ce0d3702b9c2d850d33e01dca54b818d8aa3ec90fb"
- Image build log:
Image build log:
https://gitlab.com/gableroux/unity3d/builds/490245428
The state of the project when image was built:
https://gitlab.com/gableroux/unity3d/-/tree/2dc02a81844fd3fb648f3d03be1053241e272f66
The complete Dockerfile used:
- https://gitlab.com/gableroux/unity3d/-/blob/2dc02a81844fd3fb648f3d03be1053241e272f66/docker/ubuntu_prepare.Dockerfile
- https://gitlab.com/gableroux/unity3d/-/blob/2dc02a81844fd3fb648f3d03be1053241e272f66/docker/unitysetup.Dockerfile
The configuration used to build the image:
The things related to locales for this specific image when it was built are these commands:
-
locales
is installed in base image (ubuntu_prepare) -
locale-gen en_US.UTF-8
https://gitlab.com/gableroux/unity3d/-/blob/2dc02a81844fd3fb648f3d03be1053241e272f66/docker/ubuntu_prepare.Dockerfile#L70-75
Fix
According to following related issue:
https://github.com/gradle/gradle/issues/3117
The fix should look something like this:
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
Reinstalling locales
again is useless, it's already in the prepare image. Only localedef and env lines are necessary at this point.