Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Gradle times out waiting for the journal cache lock

ErrorTimeout waiting to lock journal cache

Short answer

Another Gradle process holds the lock on the journal cache in your Gradle user home and this build waited in vain. Stop all daemons first. If it comes back on a Mac with a firewall or endpoint security tool, upgrade Gradle to 8.12.1 or newer.

  • Applies to Gradle 8 and 9, macOS, Linux
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List the Gradle daemons that are running, because a stale one is the usual holder of the lock.

    ./gradlew --status
    jps | grep GradleDaemon
  2. 2Match what you see, then jump to its fix

    1. 1The message names an owner process ID, and jps shows a GradleDaemon with that ID.A leftover or second Gradle daemon holds the lockFix
    2. 2The error repeats on macOS 15 with a firewall, VPN or endpoint security tool, with a Broken pipe in FileLockCommunicator.Firewall or endpoint security blocks daemon communicationFix

What does the error look like?

  • Timeout waiting to lock journal cache
  • It is currently in use by another Gradle instance.
  • org.gradle.cache.LockTimeoutException

Cause 1 of 2

A leftover or second Gradle daemon holds the lock

1Check

gradle --status lists daemons of the version you use; jps lists live daemons of every Gradle version.

./gradlew --status

2Fix

Stop the daemons of this version, and kill daemons of other versions by process ID.

./gradlew --stop
kill <pid-from-jps>

3Verify

Run any build.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

Cause 2 of 2

Firewall or endpoint security blocks daemon communication

1Check

A Gradle issue traces the timeout to macOS 15, its firewall and security products dropping the sockets that daemons use to ask each other to release a lock.

./gradlew --version

2Fix

Use Gradle 8.12.1 or newer, which made the lock communication more robust, then stop old daemons because a daemon started by an older version can still hold a bad lock.

./gradlew --stop
./gradlew wrapper --gradle-version 8.12.1

3Verify

Check the version and run a build.

./gradlew --version
./gradlew help

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Use the same Gradle version and JDK in every project so fewer daemons start.
  • Do not delete lock files by hand; reports say it can leave the cache corrupted.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

Spring Boot will not start because port 8080 is already taken

Action: Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

Spring Boot listens on 8080 unless told otherwise, and only one process can own a port.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.