"(Project) is already running" after crash, can't re-open

Was editing a prefab and did something it didn’t like and the Unity editor crashed out. But then I could never open the project from the Unity Hub ever again until I restarted the computer, because it kept saying the project was already open.

I used htop to find everything with “unity” or my project name, and killed a few processes I thought would be it, but still got the same error until I restarted the computer.

Does anyone know what process I should be looking for to terminate to allow me to re-open the project again?

1 Like

Try removing the Temp directory from your project. It should be in your project’s root folder (e.g., next to the Assets folder).

5 Likes

I find when this happens that there are quite a few processes flapping about.
The way that always seems to work for me is something like:

sudo kill -9 $(pidof Unity)

usually gets them all…

2 Likes

There should be a file in your project called “Temp/UnityLockFile”. If you remove it the issue should go away.

What happens is Unity creates this file when the project open if it doesn’t exist and takes an exclusive lock on it. The lock is released when Unity exists. In the case of a crash, the lock is never freed. So you have to wait for the system to get around to it or just delete the file.

This is something we could consider doing in our crash handler if you wan to log a bug on it.

13 Likes

Thank you @KevinWelton :slight_smile: your solution worked for me.

Nice !

1 Like

not working

UnityLockFile actually worked! great!

This has happened to me so many times… now I finally decided to google it and this was the first result.
I am not sure how to log a bug - is it impossible for you to do it?
It sounds like you are already aware of this bug and know how to reproduce it (and even how to fix it). And your description says you work in Unity

Why this can’t be fixed? This is in Unity Hub forever. Looks a bit weird that Unity Hub tells you that Unity is already open when you launched it last time 2 months ago.
Is it so hard to fix?

I mean - programming is about automation, why I should manually go and delete that Temp/UnityLockFile file?

go in the temp folder and just delete “unitylockfile”

THIS IS THE SOLUTION

Not for me. I have no ‘temp’ folder and it still won’t open, even after a reboot.
There must be another locking mechanism somewhere. Unity Hub 3.10.0

I read that on forums. but there is no temp folder