Nothing interesting in the daemon log:
2023-04-27T08:19:30.440+0100 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]].
2023-04-27T08:19:30.478+0100 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Thu Apr 27 08:19:30 BST 2023, with address: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]]
2023-04-27T08:19:30.482+0100 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]]
2023-04-27T08:19:30.485+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=857667ad-2f6d-4a75-9068-480cdef6eb0f,javaHome=/usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.amzn2.0.1.x86_64,daemonRegistryDir=/home/ec2-user/.gradle/daemon,pid=9261,idleTimeout=120000,priority=NORMAL,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,-Xms512m,-Xmx4g,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2023-04-27T08:19:30.496+0100 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=857667ad-2f6d-4a75-9068-480cdef6eb0f,javaHome=/usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.amzn2.0.1.x86_64,daemonRegistryDir=/home/ec2-user/.gradle/daemon,pid=9261,idleTimeout=120000,priority=NORMAL,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,-Xms512m,-Xmx4g,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2023-04-27T08:19:30.525+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2023-04-27T08:19:30.538+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] The file lock is held by a different Gradle process (pid: 9310, lockId: 5529841589515881000). Pinged owner at port 41206
2023-04-27T08:19:30.567+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:30.576+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:30.584+0100 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2023-04-27T08:19:30.585+0100 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2023-04-27T08:19:30.593+0100 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2023-04-27T08:19:30.603+0100 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2023-04-27T08:19:30.604+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
2023-04-27T08:19:40.601+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-27T08:19:40.602+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.602+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:40.604+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-27T08:19:40.605+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.606+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:40.607+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-04-27T08:19:40.607+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.607+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:40.610+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Storing daemon stop event: after the daemon was no longer found in the daemon registry
2023-04-27T08:19:40.620+0100 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon stop event with timestamp 1682579980616
2023-04-27T08:19:40.628+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2023-04-27T08:19:40.632+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.640+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:40.642+0100 [LIFECYCLE] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon will be stopped at the end of the build after the daemon was no longer found in the daemon registry
2023-04-27T08:19:40.642+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Marking daemon stopped due to after the daemon was no longer found in the daemon registry. The daemon is running a build: false
2023-04-27T08:19:40.643+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon has stopped.
2023-04-27T08:19:40.643+0100 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stop() called on daemon
2023-04-27T08:19:40.643+0100 [INFO] [org.gradle.launcher.daemon.server.Daemon] Stop requested. Daemon is removing its presence from the registry...
2023-04-27T08:19:40.643+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Removing our presence to clients, eg. removing this address from the registry: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]]
2023-04-27T08:19:40.644+0100 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Removing daemon address: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]]
2023-04-27T08:19:40.644+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2023-04-27T08:19:40.645+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.648+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-04-27T08:19:40.649+0100 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Address removed from registry.
Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a user interrupt.
2023-04-27T08:19:40.714+0100 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Removing daemon address: [1f502a5c-0ce5-4699-8992-94e8b721a3db port:37853, addresses:[localhost/127.0.0.1]]
2023-04-27T08:19:40.714+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2023-04-27T08:19:40.717+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-04-27T08:19:40.730+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
But maybe is failing the process because when the Gradle process starts to search for the created Gradle daemon It is already in process of stopping itself so It will never connect with the proccess.
Maybe a possible solution would be to increase the timeout of the Gradle daemon but I don’t find any property to do that or to avoid specifying the option --no-daemon.