24

I am trying to generate Eclipse and IDEA projects for a play project using activator. When I tried doing this, it does a little, but then it hangs at:

Waiting for lock on C:\Users\James\.ivy2\.sbt.ivy.lock to be available...

At first I thought my running session of Intellij IDEA may be conflicting, I killed IDEA and the issue persisted. I closed activator, deleted the lock file, and restarted activator, but then it recreated the lock file and gave me the same issue. This is the full log I have been getting.

[info] Loading project definition from C:\Users\James\play-java\project
[info] Set current project to play-java (in build file:/C:/Users/James/play-java/)
[info] Applying State transformations com.typesafe.sbtrc.SetupSbtChild from C:/Users/James/.sbt/boot/scala-2.10.2/com.typesafe.sbtrc/sbt-rc-probe-0-13/1.0-1a8f7afd5ba98b45834ff53dd349130c3ade22f1/sbt-rc-probe-0-13-1.0-1a8f7afd5ba98b45834ff53dd349130c3ade22f1.jar;C:/Users/James/.sbt/boot/scala-2.10.2/com.typesafe.sbtrc/sbt-rc-probe-0-13/1.0-1a8f7afd5ba98b45834ff53dd349130c3ade22f1/sbt-rc-props-1.0-1a8f7afd5ba98b45834ff53dd349130c3ade22f1.jar
[info] Updating {file:/C:/Users/James/play-java/}root...
Waiting for lock on C:\Users\James\.ivy2\.sbt.ivy.lock to be available...

How can I fix the lockfile issue?

4 Answers 4

34

The .sbt.ivy.lock file is used to synchronize access to your local ivy2 repository between several processes so they cannot modify the directory simultaneously. Usually the situation that you described happens when you have an IDE and Activator/sbt terminal running at the same time.

Even though you killed the Idea Process there could be another process spawned which was causing the lock so next time make sure that you kill all Java processes. However, the best solution for this issue is to avoid locking one process with another. So run only one process which uses the ivy2 repository at the same time.

3
  • 2
    In my case there was an activator instance which was running in background. After I killed the process, I was able to use activator
    – Halil
    Jan 12, 2015 at 21:10
  • 3
    I closed netbeans and then the activator proceeded.
    – Martlark
    Mar 4, 2015 at 0:10
  • Thanks! I killed Intellij & all my other java processes & restarted with just one process. Apr 10, 2018 at 22:39
3

If nothing works, the last step is to kill the .lock file.

4
  • Beyond a vague statement of what to do, how do you kill the .lock file? Where is it located? How can you determine where it is located? How can you determine the path to play on your machine. I'm running OSX at the moment. Any meaningful advice is appreciated.
    – zero_cool
    Mar 9, 2017 at 16:14
  • 3
    killall -9 java will kill all java processes.
    – zero_cool
    Mar 9, 2017 at 16:18
  • 2
    Old, but wanted to leave the extra detail for zero_cool: The lock message generally includes the entire path: Waiting for lock on /foo/bar/.ivy2/.sbt.ivy.lock to be available... From there, just delete the .sbt.ivy.lock file and try again
    – Mike Emery
    Mar 24, 2017 at 16:18
  • 2
    Just in case it helps @zero_cool: On my mac (Sierra) it was located at /Users/<userid>/.ivy2/.sbt.ivy.lock
    – Santhosh
    Apr 12, 2017 at 9:00
2

I faced a similar issue, I was also getting the same error

Waiting for lock on C:\Users\ajain9\.ivy2\.sbt.ivy.lock to be available...

Then finally the issue was that there was another sbt process running on my system, and because of that the .sbt.ivy.lock file was not being available. As explained well by Daniel, lock file is used for synchronization purpose.

Once the previous process ended,I did not face this error again.

0

mac users, just do ps -ef | grep -i sbt, and kill the process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.