Build daemon crashes when I run an Android build in docker

Bitrise Build Issue Report template

Description of the issue

I’ve followed the steps in https://devcenter.bitrise.io/tutorials/docker/run-your-build-locally-in-docker/ to run my bitrise workflow in docker and the build failed with this issue:

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 --info or --debug option to get more log output. Run with --scan to get full insights.

Exception is:
    org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

I tried every suggestions from this post but unfortunately didn’t manage to fix it https://stackoverflow.com/questions/37171043/gradle-build-daemon-disappeared-unexpectedly-it-may-have-been-killed-or-may-hav

Environment:

I got that same error on both of these docker images:

On bitrise.io it works fine with the exact same repo with the image bitriseio/android-ndk-lts.

Build log


> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE
Configuration on demand is an incubating feature.
^[File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Platform 29 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 3)".
"Install Android SDK Platform 29 (revision: 3)" ready.
Installing Android SDK Platform 29 in /opt/android-sdk-linux/platforms/android-29
"Install Android SDK Platform 29 (revision: 3)" complete.
"Install Android SDK Platform 29 (revision: 3)" finished.
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=edfb2eb5-bf28-4122-8866-f3083d6d822b, currentDir=/bitrise/src}
Attempting to read last messages from the daemon log...
Daemon pid: 590
  log file: /root/.gradle/daemon/6.0.1/daemon-590.out.log
----- Last  20 lines from daemon log file - daemon-590.out.log -----
2019-11-28T13:56:36.446+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 19: dispatching class org.gradle.launcher.daemon.protocol.BuildStarted
2019-11-28T13:56:36.448+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: {PATH=/root/.bitrise/tools:/bitrise/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/tools/bin:/opt/android-sdk-linux/platform-tools:/opt/android-ndk, PR=false, GRADLEW_PATH=./gradlew, GRADLE_BUILD_FILE_PATH=build.gradle, unit_test_task=clean spotlessCheck testStagingEnvRelease :reactivelocation:testRelease :extratools:testNoOpReleaseUnitTest --stacktrace --scan, BITRISE_DEPLOY_DIR=/bitrise/deploy, BITRISE_STEP_SOURCE_DIR=/tmp/bitrise055570708/step_src, ANDROID_HOME=/opt/android-sdk-linux, gradlew_file_path=./gradlew, TOOL_VER_DOCKER_COMPOSE=1.19.0, LD_LIBRARY_PATH=/opt/android-sdk-linux/tools/lib64:/opt/android-sdk-linux/emulator/lib64:/opt/android-sdk-linux/emulator/lib64/qt/lib, BITRISE_IO=true, ANDROID_NDK_VERSION=r16b, BITRISE_STEP_FORMATTED_OUTPUT_FILE_PATH=/tmp/bitrise055570708/formatted_output.md, BITRISE_SOURCE_DIR=/bitrise/src, PWD=/bitrise/src, BITRISE_PREP_DIR=/bitrise/prep, LOGLEVEL=info, GCLOUD_SDK_CONFIG=/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json, BITRISE_TEST_RESULT_DIR=/tmp/test_results970484579/test_result691604877, LANGUAGE=en_US.UTF-8, ANDROID_NDK_HOME=/opt/android-ndk, GOPATH=/bitrise/go, OLDPWD=/bitrise/src, BITRISE_TRIGGERED_WORKFLOW_ID=staging-build-tests, BITRISE_TRIGGERED_WORKFLOW_TITLE=staging-build-tests, BITRISE_CACHE_DIR=/bitrise/cache, LC_ALL=en_US.UTF-8, BITRISE_BUILD_STATUS=0, BITRISE_SECRET_FILTERING=true, SHLVL=0, QT_QPA_PLATFORM=offscreen, TOOL_VER_DOCKER=17.12.0, ENVMAN_ENVSTORE_PATH=/tmp/bitrise055570708/output_envstore.yml, TOOL_VER_RUBY=2.5.1, LANG=en_US.UTF-8, cache_level=only deps, BITRISE_DOCKER_REV_NUMBER_ANDROID=v2017_12_29_1, BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS=v2019_11_13_1, BITRISE_TMP_DIR=/bitrise/tmp, BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK=v2017_12_08_1, TOOL_VER_GO=1.10.1, BITRISE_DOCKER_REV_NUMBER_BASE=v2018_04_11_1, CI=false, unit_test_flags=--continue, BITRISE_TEST_DEPLOY_DIR=/tmp/test_results970484579, HOSTNAME=b1d0697e898b, TOOL_VER_BITRISE_CLI=1.36.0, gradle_file=build.gradle, STEPLIB_BUILD_STATUS=0, HOME=/root, BITRISE_BRIDGE_WORKDIR=/bitrise/src}
2019-11-28T13:56:36.452+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 17: received class org.gradle.launcher.daemon.protocol.CloseInput
2019-11-28T13:56:36.452+0000 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 17: Received IO message from client: org.gradle.launcher.daemon.protocol.CloseInput@8e2ddd5
2019-11-28T13:56:36.456+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
2019-11-28T13:56:36.457+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 590). The daemon log file: /root/.gradle/daemon/6.0.1/daemon-590.out.log
2019-11-28T13:56:36.459+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting build in new daemon [memory: 4.8 GB]
2019-11-28T13:56:36.461+0000 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] Closing daemon's stdin at end of input.
2019-11-28T13:56:36.461+0000 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] The daemon will no longer process any standard input.
2019-11-28T13:56:36.468+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
2019-11-28T13:56:36.468+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=b76d7688-3ed6-416e-8bbf-6c419d2acda8,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/root/.gradle/daemon,pid=590,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx5120M,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Configuration on demand is an incubating feature.
File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Platform 29 in /opt/android-sdk-linux/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 3)".
"Install Android SDK Platform 29 (revision: 3)" ready.
Installing Android SDK Platform 29 in /opt/android-sdk-linux/platforms/android-29
"Install Android SDK Platform 29 (revision: 3)" complete.
"Install Android SDK Platform 29 (revision: 3)" finished.
----- 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 --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.