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

Gradle Build daemon crashes if the environment variables contain non-ASCII characters #3117

Closed
JehandadK opened this issue Oct 10, 2017 · 38 comments
Assignees
Labels
a:bug @core Issue owned by GBT Core
Milestone

Comments

@JehandadK
Copy link

JehandadK commented Oct 10, 2017

Expected Behavior

Gradle daemon should not get killed unexpectedly.

Current Behavior

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.

Steps to Reproduce (for bugs)

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.

Your Environment

Jenkins with Docker. I am using Jenkinsfile with Declarative syntax.

@JehandadK JehandadK changed the title Gradle Build deamon crashes if the Environment variables contain illegal character Gradle Build daemon crashes if the environment variables contain some characters Oct 10, 2017
@bigdaz
Copy link
Member

bigdaz commented Oct 10, 2017

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:

  1. Provide a full reproducible example project (either as an archive or as a Github repo). This makes sure we can easily see the same issue you are experiencing.
  2. If a reproducible example is infeasible, please provide detailed instructions on the environment and how to reproduce the issue.
  3. If your environment is too hard to reproduce, you can use -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.

@bigdaz bigdaz closed this as completed Oct 10, 2017
@socketbind
Copy link

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).

@JehandadK
Copy link
Author

I just want to know why this "EstablishBuildEnvironment" log does not appear on local environment. And perhaps how can I produce it.

@inv3rse
Copy link

inv3rse commented Oct 12, 2017

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'

@bigdaz bigdaz changed the title Gradle Build daemon crashes if the environment variables contain some characters Gradle Build daemon crashes if the environment variables contain non-ASCII characters Oct 12, 2017
@bigdaz
Copy link
Member

bigdaz commented Oct 12, 2017

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!)

@bigdaz bigdaz reopened this Oct 12, 2017
privat added a commit to nitlang/nit that referenced this issue Nov 29, 2017
this should fix the CI tests when people with international names make PR.

ref: gradle/gradle#3117

Pull-Request: #2590
@hardysim
Copy link

hardysim commented Dec 13, 2017

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.

@blindpirate
Copy link
Collaborator

@hardysim Thanks for reporting, I'd like you to provide more information:

  • Your CI infrastructure? e.g. docker image/JDK version/CI version etc.
  • Your Gradle version?
  • Can you reproduce it locally with exactly same code?
  • What's the specific non-ascii username (you can refuse to provide if it's confidential)?

That would help. Thanks a lot.

@blindpirate
Copy link
Collaborator

blindpirate commented Dec 13, 2017

This looks very much like a locale issue to me.

@JehandadK @socketbind @inv3rse Could you provide some more information about this crash?

  • Environment (more details would be appreciated). CI version/Docker image/JDK version/Gradle version/
  • The characters which caused this issue (if possible)
  • Can you reproduce it locally (with the same docker image)?

I'd appreciate these information, thank you.

@hardysim
Copy link

hardysim commented Dec 13, 2017

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 😉).

@zitnik
Copy link

zitnik commented Dec 13, 2017

I've just come across the same issue.
I'm using

  • GitLab CI (GitLab Community Edition 10.2.0-rc1) Runner
  • this Docker image: jangrewe/gitlab-ci-android
  • OpenJDK version "1.8.0_131"
  • Gradle 3.3
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.

@hardysim
Copy link

@zitnik maybe my updated docker-image can help you:

image: registry.gitlab.com/hardysim/android-ci:latest

@blindpirate
Copy link
Collaborator

blindpirate commented Dec 13, 2017

@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.

@ofaurax
Copy link

ofaurax commented Jun 15, 2018

Confirmed on gradle 4.7: we get the crash from gitlab CI on every commit with french characters ("éà...") in CI_COMMIT_DESCRIPTION env variable

@trapacska
Copy link

trapacska commented Jul 17, 2018

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: mindrunner/docker-android-sdk#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!

@p-schneider
Copy link
Contributor

p-schneider commented Jul 17, 2018

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.)

amirh pushed a commit to amirh/flutter that referenced this issue Jan 3, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
amirh added a commit to flutter/flutter that referenced this issue Jan 4, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
amirh added a commit to flutter/plugins that referenced this issue Jan 4, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
@schroedingerscode
Copy link

@davidschreiber so you're using the WIP app too, eh? And thanks @miguelslemos, we'll have to give that a try.

@big-guy big-guy added this to the 5.3 RC1 milestone Jan 18, 2019
@big-guy big-guy added the @core Issue owned by GBT Core label Jan 31, 2019
@ghale ghale self-assigned this Jan 31, 2019
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this issue Feb 12, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
@davidschreiber
Copy link

@schroedingerscode not sure what WIP app is?

andreidiaconu pushed a commit to andreidiaconu/plugins that referenced this issue Feb 17, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
@ghale
Copy link
Member

ghale commented Feb 18, 2019

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.

@AlexisBRENON
Copy link

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

@Nindouja
Copy link

In wich release this will be live ?

@big-guy
Copy link
Member

big-guy commented Mar 18, 2019

5.3, there's a release candidate out for it now: https://docs.gradle.org/5.3-rc-3/release-notes.html

collinjackson pushed a commit to firebase/flutterfire that referenced this issue Aug 14, 2019
Cirrus puts the PR description and commit message in environment
variables.
These messages tend to have non ASCII characters sometimes (like
emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting
in Gradle crashing without a helpful error message.

The real solution to this problem should be fixing the Gradle bug.
The better workaround on the Flutter side would be to set a UTF8 locale
on the Cirrus machine, but I have yet figured out how to do it.
For now to avoid more people from hitting this I'm working around by
temporarily unsetting the Cirrus environment variables with the PR
description and commit message.

A non ASCII character to make sure it works: 😄
@julianmojico
Copy link

julianmojico commented Nov 6, 2019

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

@PiciKacsa
Copy link

I was using it with docker and gitlab for Unity, the problem was indeed the non-ASCII character. My real (and this way, my GitLab) name contains an 'ó', which was passed down as an ENV variable, causing the issue. Fixed it by renaming myself on GitLab.

@Halkcyon
Copy link

I am also seeing this behavior with Gradle Sync where my computer name is an emoji character. I get the following feedback in IntelliJ:

- Unknown host 'No such host is known (??)'. You may need to adjust the proxy settings in Gradle.
- java.net.UnknownHostException: ??: No such host is known (??)
- > ??: No such host is known (??)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug @core Issue owned by GBT Core
Projects
None yet
Development

No branches or pull requests