Why would my play framework say wait for a .sbt lock to be available?
Asked Answered
V

4

18
[Sally] $ run

[info] Updating {file:/Users/MyName/Desktop/sally/todolist/}Sally...
Waiting for lock on /Users/MyName/Documents/play-2.1.3/repository/.sbt.ivy.lock to be available...

Sally is my project's name. I am learning how to use play. Yesterday It was all awesome. Today when I woke up and opened my computer, everything went to hell. I kept seeing this message when I try to run the program.

What is this lock anyway? Should I uninstall/remove the framework and reinstall it?? (Btw how do I do that?)

Ventral answered 2/9, 2013 at 18:6 Comment(0)
B
47

Just remove the .lock file. It is used when resolving dependancies and to avoid conflicts if you launch two Play consoles.

Bova answered 2/9, 2013 at 18:55 Comment(4)
YES! I have that question too! So what if I have one play project and I decide to move to a different play project. Do I just go to that directory and type in "play"? I think this got me into this lock trouble in the first place.Ventral
Yes, you can type Play. But I think you had the problem because you kill the play process before it could finish the dependencies resolution. Normally, this problem shouldn't happen.Bova
@nico_ekito everytime i try to delete .lock it says that the file is currently used by another apps (IntelliJ). When i close the app, and delete the file it works. But, when i start the app again, it automatically creates the files/folders. Any suggestion ?Symposiarch
Where is the .lock file located?Itol
F
4

I ran the following commands to fix this.

$ ps aux | grep sbt

Get the process ids and kill it.(like below)

$ kill -9 112233 565644

And then run sbt run to start the app.

Flavorous answered 22/2, 2019 at 15:57 Comment(0)
T
0

Deleting the .lock file also works. But if you don't want to delete the lock file, you can unlock the file from the process which has the lock. If you are on windows, you can use a UI tool called "Unlocker" to do this (go to that file=>right click=>select unlocker).

Trundle answered 23/3, 2016 at 13:50 Comment(2)
What about MacOS?Lizbeth
@AabanTariqMurtaza Try this: Open the Terminal. Type the following command, followed by a single space (do not press enter yet). sudo chflags nouchg. Drag the locked file from the Finder to the Terminal window to complete its full folder path. Press Enter to run the command, supplying your password when prompted.Ruckman
A
0

On my windows machine, I managed to solve the above issue by killing the processes that use that lock file.

Use the following official tool from Microsoft to search for the processes that are using the lock file.

https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer

Arose answered 16/10, 2018 at 11:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.