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 · 35 comments

Comments

Projects
None yet
@JehandadK
Copy link

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

This comment has been minimized.

Copy link
Member

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 Oct 10, 2017

@socketbind

This comment has been minimized.

Copy link

commented Oct 10, 2017

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

This comment has been minimized.

Copy link
Author

commented Oct 11, 2017

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

@inv3rse

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

Merge: tests: force a utf8 locale because gradle don't like pure ascii
this should fix the CI tests when people with international names make PR.

ref: gradle/gradle#3117

Pull-Request: #2590
@hardysim

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

@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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Dec 13, 2017

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

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

@blindpirate

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

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

@amirh

This comment has been minimized.

Copy link

commented Dec 19, 2018

Looks like we're hitting the same issue running gradle daemon on Cirrus (flutter/flutter#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)
@etuardu

This comment has been minimized.

Copy link

commented Dec 21, 2018

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.

amirh added a commit to amirh/plugins that referenced this issue Jan 3, 2019

Workaround the Gradle crash due to non ASCII chars.
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 amirh/flutter that referenced this issue Jan 3, 2019

[WIP] Workaround the Gradle crash due to non ASCII chars.
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 amirh/flutter that referenced this issue Jan 3, 2019

Workaround the Gradle crash due to non ASCII chars.
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 amirh/flutter that referenced this issue Jan 3, 2019

Workaround the Gradle crash due to non ASCII chars.
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

Workaround the Gradle crash due to non ASCII chars. (#26024)
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

Workaround the Gradle crash due to non ASCII chars. (#1031)
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

This comment has been minimized.

Copy link

commented Jan 12, 2019

@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 label Jan 31, 2019

@ghale ghale self-assigned this Jan 31, 2019

kangwang1988 added a commit to alibaba-flutter/flutter that referenced this issue Feb 12, 2019

Workaround the Gradle crash due to non ASCII chars. (flutter#26024)
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: 😄

@adammurdoch adammurdoch referenced this issue Feb 12, 2019

Merged

Upgrade to new version of native-platform #8492

0 of 11 tasks complete
@davidschreiber

This comment has been minimized.

Copy link

commented Feb 15, 2019

@schroedingerscode not sure what WIP app is?

andreidiaconu added a commit to andreidiaconu/plugins that referenced this issue Feb 17, 2019

Workaround the Gradle crash due to non ASCII chars. (flutter#1031)
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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Feb 19, 2019

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

@ghale ghale closed this Feb 22, 2019

@BancarelValentin

This comment has been minimized.

Copy link

commented Mar 14, 2019

In wich release this will be live ?

@big-guy

This comment has been minimized.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.