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

Docker compose build fails with exception #655

Closed
mikeplotean opened this issue Jul 30, 2024 · 1 comment
Closed

Docker compose build fails with exception #655

mikeplotean opened this issue Jul 30, 2024 · 1 comment
Assignees

Comments

@mikeplotean
Copy link
Contributor

Describe the bug
When trying to build local images to use with docker compose, the build fails for wallet-api with a gradle daemon error:

 Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

To Reproduce

  1. Go to 'docker-compose' folder
  2. run docker compose build
  3. or run docker compose up --build

Expected behavior

  • command runs successfully
  • local images having the VERSION_TAG are built for: wallet-api, issuer-api, verifier-api, waltid-web-wallet, web-portal

Actual behavior

  • command execution fails

Screenshots

> [wallet-api buildstage 23/23] RUN gradle clean installDist:
6.562 Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
169.3 The message received from the daemon indicates that the daemon has disappeared.
169.3 Build request sent: Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api}
169.3 Attempting to read last messages from the daemon log...
169.7 Daemon pid: 42
169.7   log file: /home/gradle/.gradle/daemon/8.9/daemon-42.out.log
170.6 ----- Last  20 lines from daemon log file - daemon-42.out.log -----
170.6 2024-07-30T19:08:50.261+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 21: received class org.gradle.launcher.daemon.protocol.Build
170.6 2024-07-30T19:08:50.262+0000 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 21: Received non-IO message from client: Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api}
170.6 2024-07-30T19:08:50.264+0000 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api}.
170.6 2024-07-30T19:08:50.269+0000 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api} with connection: socket connection from /127.0.0.1:44805 to /127.0.0.1:32900.
170.6 2024-07-30T19:08:50.287+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api}, connection = DefaultDaemonConnection: socket connection from /127.0.0.1:44805 to /127.0.0.1:32900] after 0.0346 minutes of idle
170.6 2024-07-30T19:08:50.288+0000 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [a401026b-491c-4f1e-8324-626ac1a8e5ce port:44805, addresses:[localhost/127.0.0.1]]
170.6 2024-07-30T19:08:50.290+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [a401026b-491c-4f1e-8324-626ac1a8e5ce port:44805, addresses:[localhost/127.0.0.1]]
170.6 2024-07-30T19:08:50.292+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
170.6 2024-07-30T19:08:50.296+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
170.6 2024-07-30T19:08:50.304+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
170.6 2024-07-30T19:08:50.305+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
170.6 2024-07-30T19:08:50.306+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
170.6 2024-07-30T19:08:50.312+0000 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=b5deea40-192e-483a-80fd-0dbe1e2b9532, currentDir=/work/waltid-services/waltid-wallet-api}. Dispatching build started information...
170.6 2024-07-30T19:08:50.312+0000 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 23: dispatching org.gradle.launcher.daemon.protocol.BuildStarted@236a3830
170.6 2024-07-30T19:08:50.323+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: [PATH, LANGUAGE, LC_ALL, GRADLE_VERSION, JAVA_HOME, PWD, JAVA_VERSION, LANG, HOME, GRADLE_HOME]
170.6 2024-07-30T19:08:50.337+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
170.6 2024-07-30T19:08:50.338+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 42). The daemon log file: /home/gradle/.gradle/daemon/8.9/daemon-42.out.log
170.6 2024-07-30T19:08:50.344+0000 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting build in new daemon [memory: 2 GiB]
170.6 2024-07-30T19:08:50.362+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
170.6 2024-07-30T19:08:50.364+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=2af544d8-d9e8-4600-9429-4223e0f5b754,javaHome=/opt/java/openjdk,javaVersion=17,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=42,idleTimeout=10800000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=--add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx2048m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]----- End of the daemon log -----
170.6
170.6
170.6 FAILURE: Build failed with an exception.
170.6
170.6 * What went wrong:
170.6 Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
170.6
170.6 * Try:
170.6 > Run with --stacktrace option to get the stack trace.
170.6 > Run with --info or --debug option to get more log output.
170.6 > Run with --scan to get full insights.
170.6 > Get more help at https://help.gradle.org.
------
failed to solve: process "/bin/sh -c gradle clean installDist" did not complete successfully: exit code: 1

Environment

  • Windows 10
  • docker: 26.1.4
  • compose: v2.27.1-desktop.1
@mikeplotean mikeplotean changed the title Docker compose build failed with exception Docker compose build fails with exception Jul 30, 2024
@mikeplotean
Copy link
Contributor Author

mikeplotean commented Sep 18, 2024

This is caused by running on low resources, in particular memory.

In order to avoid this issue, it is needed to increase the memory limit for docker engine.
This can be done from:

  • docker desktop
  • or the settings.json file

Increase memory limit from docker desktop

  1. open docker desktop
  2. open 'Settings'
  3. select 'Resources'
  4. select 'Advanced'
  5. move the memory knob to the desired value (2nd scrollbar from top)
  6. click 'Apply & Restart'

Untitled

Increase memory limit from docker settings file

To change the docker engine memory limit, update the memoryMiB value from settings.json file:

  1. Locate the settings.json file:
    • windows: C:\Users%userprofile%\AppData\Roaming\Docker\settings.json
    • linux: ~/.docker/desktop/settings.json
    • macos: ~/Library/Group Containers/group.com.docker/settings.json
  2. update the memoryMiB value, in MB
    • e.g. "memoryMiB": 8192, for 8GB
  3. save and close
  4. restart docker engine

More details about docker settings can be found in docker docs.

@walt-id walt-id locked and limited conversation to collaborators Sep 18, 2024
@mikeplotean mikeplotean converted this issue into a discussion Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant