[GRADLE-1723] impossible to acquire lock problem when resolving dependencies Created: 05/Aug/11  Updated: 04/Jan/13  Resolved: 12/Oct/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-4
Fix Version/s: 1.0-milestone-5

Type: Bug
Reporter: Szczepan Faber Assignee: Adam Murdoch
Resolution: Fixed Votes: 3

Attachments: Text File thread-dump.txt    

 Description   

Symptom

A typical console output when this error occurs:

                       ::::::::::::::::::::::::::::::::::::::::::::::

                       ::          UNRESOLVED DEPENDENCIES         ::

                       ::::::::::::::::::::::::::::::::::::::::::::::

                       :: org.grails#grails-docs;1.3.6: not found

                       ::::::::::::::::::::::::::::::::::::::::::::::


       :::: ERRORS
               impossible to acquire lock for org.grails#grails-docs;1.3.6

               impossible to acquire lock for org.grails#grails-docs;1.3.6

               impossible to acquire lock for org.grails#grails-docs;1.3.6

               impossible to acquire lock for org.grails#grails-docs;1.3.6

Workaround

With the build not running, see if you have any .lck files anywhere under $homeDir/caches/artifacts. You should delete these - if they are present Ivy will complain that it cannot acquire the lock. It looks like ivy/wharf is not always cleaning these up when the build process exits.



 Comments   
Comment by René Gröschke (Inactive) [ 07/Aug/11 ]

As mentioned on the mailinglist, I get the same error in one of our multiprojectbuilds. before starting the mp build, there are no lck files in my cache directory. after the failed build there are no lck files either. it seems, that a subproject creates the lock on a library and another subproject with the same dependency. it's always the same dependency that fails, but i havn't yet figured out, what the special scenario with this dependency is. regards, rene

Comment by Davide Cavestro [ 21/Sep/11 ]

Just hit the same problem with 1.0-milestone-4, though I haven't seen any error: the process seems hanging, or maybe I should wait some time to get a failure. 1.0-milestone-3 works fine.
I'm going to attach a thread dump as thread-dump.txt

Comment by Davide Cavestro [ 21/Sep/11 ]

I noticed there actually was a .lck file that caused milestone-4 to hang

find ~/.gradle/caches/artifacts/ -name "*.lck" 
/home/davide/.gradle/caches/artifacts/asm/asm-util/wharfdata-3.2.kryo.lck

Removing it while a milestone-4 process was hanging, it continued soon with no problems.
As a last note, I saw Adam Murdoch filed a related issue at WHARF-26.

Generated at Wed Jun 30 12:02:44 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.