Search Unity

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

Discussion in 'Linux' started by Domarius, Mar 27, 2022.

  1. Domarius

    Domarius

    Joined:
    Jan 5, 2013
    Posts:
    103
    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?
     
  2. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    Try removing the Temp directory from your project. It should be in your project's root folder (e.g., next to the Assets folder).
     
    HunnyMalik, imajunytion and odumo like this.
  3. AlfieBooth

    AlfieBooth

    Joined:
    Dec 2, 2013
    Posts:
    31
    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...
     
    adbourdages and Pnvanol like this.
  4. KevinWelton

    KevinWelton

    Joined:
    Jul 26, 2018
    Posts:
    239
    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.
     
  5. kittphi

    kittphi

    Joined:
    Feb 17, 2019
    Posts:
    4
  6. thanhle

    thanhle

    Joined:
    May 2, 2013
    Posts:
    162
    Nice !
     
    sfjohansson likes this.
  7. anurag242002

    anurag242002

    Joined:
    Apr 16, 2023
    Posts:
    1
    not working
     
  8. timmy2get

    timmy2get

    Joined:
    Mar 2, 2018
    Posts:
    12
    UnityLockFile actually worked! great!
     
  9. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    147
    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
     
    Last edited: Mar 4, 2024
  10. Dimaman

    Dimaman

    Joined:
    Feb 14, 2015
    Posts:
    1
    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?
     
  11. Sammydragonlord

    Sammydragonlord

    Joined:
    Apr 1, 2023
    Posts:
    1
    go in the temp folder and just delete "unitylockfile"
     
  12. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    142
    THIS IS THE SOLUTION