'Could not open buildscript class cache' in parallel builds


We regularly have issues in our CI when a long running integration test runs in parallel with a smaller job on the same slave. It seems the long running job keeps a lock on something in the gradle cache.

We apply a script from a URL in one of our init scripts. Resulting in the error as seen in this gist.

The offending snippet is a straightforward ‘allprojects { apply from: ‘http://the.url.com/stuff.gradle’ }’.

The environment is gradle 1.4 on Linux (ubuntu 12 LTS) although I’ve seen it on Mac OS as well.

In the past I’ve worked around similar issues by relocating the gradle cache but it seems the command line option for that has gone away?



I’m getting this problem with Gradle 1.9-rc-3 (and rc-2)

  • Where: Script ‘F:\dev\BuildScripts\MyMasterPlugin.gradle’ line: 18

  • What went wrong: A problem occurred evaluating script. > Could not open buildscript class cache for script ‘F:\dev\BuildScripts\MyLoggingPlugin.gradle’ (C:\Users\scott.gradle\caches\1.9-rc-3\scripts\MyLoggingPlugin_6mqkjr1dm8ldv061klekqj18ro\DefaultScript\buildscript).

Timeout waiting to lock buildscript class cache for script ‘F:\dev\BuildScripts\MyLoggingPlugin.gradle’ (C:\Users\scott.gradle\caches\1.9-rc-3\scripts\MyLoggingPlugin_6mqkjr1dm8ldv061klekqj18ro\DefaultScript\buildscript). It is currently in use by another Gradle instance.

Owner PID: unknown

Our PID: 2672

Owner Operation: unknown

Our operation:

Lock file: C:\Users\scott.gradle\caches\1.9-rc-3\scripts\MyLoggingPlugin_6mqkjr1dm8ldv061klekqj18ro\DefaultScript\buildscript\cache.properties.lock

(having trouble getting this formatted correctly on this forum)

Can you please verify with 1.9 final, and if you are still having the issue provide some more detail. Particularly about the project setup and OS.