Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug Getting stuck on Domain Reload

Discussion in 'Editor & General Support' started by Sebioff, Dec 21, 2022.

  1. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Since updating to Unity 2022.2 the editor keeps getting stuck on Reloading Domain on every second or third recompile roughly.

    upload_2022-12-21_12-43-34.png

    The Editor.log just shows that it compiled assemblies, and then says:
    Nothing else gets logged afterwards.

    What can I do to figure out what's going on?
     
    vi_s and Snedden27 like this.
  2. Cornysan

    Cornysan

    Joined:
    Sep 29, 2022
    Posts:
    1
    Same issue here
     
  3. whateverbigboss

    whateverbigboss

    Joined:
    Sep 9, 2015
    Posts:
    1
    Same issue
     
  4. Crocoder

    Crocoder

    Joined:
    Mar 19, 2019
    Posts:
    12
    Same issue, bump?
     
  5. Ivy-SM

    Ivy-SM

    Joined:
    Apr 18, 2013
    Posts:
    31
    Same with one of my projects. Is there a way to cancel the domain reload and try again?
    Also turning off the domain reload from project settings does not help.
    I think I isolated the problem to a dll (Rehci.SshNet.dll), but unfortunately it's essential for my project and I cannot just remove it.
     
  6. Ivy-SM

    Ivy-SM

    Joined:
    Apr 18, 2013
    Posts:
    31
    I tested on different versions of Unity (2021, 2022, 2023) and all have the same problem. Sometimes it works fine for an hour, but there are cases where it gets stuck every time I make a change. And what bothers me the most is: I have turned off the domain reload in the settings and it still does it.
    Does anybody have an idea how to REALLY turn it off?
     
  7. FWCorey

    FWCorey

    Joined:
    Feb 2, 2011
    Posts:
    42
    Bump - Unity 2022.2.5
    Only fix is reboot pc and then delete the temp and library folders before re-opening the project.
     
  8. curtispelissier

    curtispelissier

    Joined:
    Jul 26, 2019
    Posts:
    39
    Same issue with Unity 2022.2.6f1

    Even deleting Library and Temp doesn't seem to work...
     
  9. Darkgaze

    Darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    392
    For me it happens when I connect Visual Studio for debugging, then click the "Enable debugging mode" and then it starts to reload domain... and stays there for minutes. I stop the debugging session and it's stuck, Visual and Unity. I have to restart both. And this happens too often.
     
  10. jaindevesh144

    jaindevesh144

    Joined:
    Jan 31, 2022
    Posts:
    1
    Should we use older version then?
     
  11. oreo_hbi

    oreo_hbi

    Joined:
    Apr 20, 2022
    Posts:
    4
    same issue, 2022.2.9f1 and 2022.2.11f1
     
  12. talila

    talila

    Joined:
    Mar 6, 2015
    Posts:
    26
    We're having the same issue here
     
  13. slava_pankratov

    slava_pankratov

    Joined:
    Jan 17, 2015
    Posts:
    47
    same issue when opening project... it's terrible :(
     
    MuntyMcFly likes this.
  14. jbat100

    jbat100

    Joined:
    Feb 5, 2016
    Posts:
    4
    Same issue here, stuck can't work, really bad...
     
  15. wolfadactyl

    wolfadactyl

    Joined:
    Nov 18, 2013
    Posts:
    6
    Yeah this issue is brutal - I can't even get my project to open now. I've tried several different editor versions and they all just hang at "completing domain".
     
  16. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    I'm having the same issue. I was in the middle of working and haven't had the chance to save yet and now my Editor is just stuck "reloading domain".
     
  17. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
  18. StarBornMoonBeam

    StarBornMoonBeam

    Joined:
    Mar 26, 2023
    Posts:
    209
    I upgraded yesterday to the latest lts version and noticed a reduction in domain reloading times. So maybe it's time to update hub and editor if you have not done so already.
     
  19. wolfadactyl

    wolfadactyl

    Joined:
    Nov 18, 2013
    Posts:
    6
    I was able to fix this on my end by opening in safe mode, removing some packages, exiting safe mode, and then re-adding them. I don't remember exactly which packages, but at the very least I removed entities 1.0 + physics, and I think URP and maybe one other.
     
    Unity_Javier likes this.
  20. wolfadactyl

    wolfadactyl

    Joined:
    Nov 18, 2013
    Posts:
    6
    As a follow up here - was still having issues with the previous version but it looks like it might be fixed on or before 2022.2.20f1. I just updated my client and am able to open cleanly without needing to start in safe mode or remove + re-add packages. Huzzah!
     
  21. psyycker

    psyycker

    Joined:
    May 11, 2017
    Posts:
    1
    Same issue here as of 2022.2.20..
     
  22. zexzill

    zexzill

    Joined:
    Mar 6, 2019
    Posts:
    3
    got my problem fixed by deleting the .dll files instead of disabling it in the editors,
    how to safely close the unity app :
    if this bug happens is just close the unity program after a short time when loading domain dissapeared and click on discard changes.
    next, check up on the assemblies that goes wrong with it and delete it instead
     
  23. Deleted User

    Deleted User

    Guest

    same problem here, unity 2022.2.11f1... incredibly incredibly frustrating to randomly loose your work once in a while
     
  24. Snedden27

    Snedden27

    Joined:
    Jul 4, 2020
    Posts:
    8
    same , happened when I started debugging session and tried to update code in visual as unity editor was enabling debugging for the current session, had to force quit unity editor and restart , did loose some work :(
     
  25. Celsyum

    Celsyum

    Joined:
    Mar 4, 2019
    Posts:
    5
    i had this issue and its easy to reproduce. My fix was simple. I was working with namedPipes. If i created new NamedPipeServerStream and during testing i forgot to disconnect and dispose on time and just stopped Play mode manually - somehow Unity keeps connected to that pipe and Domain Reload always hangs up and crashes Unity when i edit code later on. So make sure you drop all kind of connections , like pipe, sql or other type of connections , which left open after stopping play mode (or during error).It might hang your Unity every time you modify code later on.
    So simple fix - do not forget OnApplicationQuit() and dispose of any connection you have. And manage your errors gracefully :D
     
  26. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    95
    Same here.
    My hang is accompanied by a rapidly growing memory leak, so I have a limited time to kill Unity before my whole computer starts seizing up.
     
  27. RobinHut3

    RobinHut3

    Joined:
    Apr 6, 2022
    Posts:
    6
    same, cant even close Unity whitout getting stuck.
     
  28. JosephStar318

    JosephStar318

    Joined:
    Jun 20, 2022
    Posts:
    20
    This seriously needs a fix
     
    chikchik likes this.
  29. gustmsalmeron

    gustmsalmeron

    Joined:
    Mar 2, 2021
    Posts:
    9
    Same issue, started recently, 2022.3.1f1. The only thing I started doing recently, was building cutscenes for my project, is it related to playables maybe?
     
  30. bart_artanim

    bart_artanim

    Joined:
    Jul 18, 2018
    Posts:
    19
    We have the same issue after updating to 2022.3.6f1 (and 2022.3.7f1) from 2022.2.2f1. I've tried to follow the instructions at https://forum.unity.com/threads/debugging-editor-freezes-and-hangs-windows-only.1259924/ but the information I gather is not very insightful to me.

    I'm not sure if the 0 entries should in fact show more information and I'm doing something wrong, but these versions have seriously crippled our workflow, even though they have bugfixes we absolutely need.

    upload_2023-8-10_20-2-26.png
     
  31. JBacal

    JBacal

    Joined:
    Jun 6, 2015
    Posts:
    59
    Same issue here.
     
  32. harumaron

    harumaron

    Joined:
    Jun 24, 2019
    Posts:
    2
    Same issue with Unity 2022.3.5f1...
     
  33. SAMYTHEBIGJUICY

    SAMYTHEBIGJUICY

    Joined:
    Jul 12, 2023
    Posts:
    45
    Man this bug sucks I hope they fix it soon ;_____________; (2022.3.4f1)
     
  34. Nanachi88

    Nanachi88

    Joined:
    Aug 10, 2022
    Posts:
    14
    same issue. Stuck in reloading domain and unity force close. Unity 2022.3.6f1 and Unity 2021.3.11f1
     
  35. thomasvaniseghemSB

    thomasvaniseghemSB

    Joined:
    Sep 15, 2022
    Posts:
    13
    Same issue on 2022.3.8f1

    Update: also happens when a debugger is attached
     
    Last edited: Sep 4, 2023
  36. alemnunez

    alemnunez

    Joined:
    Mar 15, 2023
    Posts:
    6
    This problem drove me crazy for 3 days until I found the problem.

    I am using Rider as the editor, and I had the "Automatically refresh assets in Unity" setting enabled (in Settings -> Languages & Frameworks -> Unity Engine). This apparently triggers a loop in some situations where unity is reloading the domain, rider detects a change, tells unity about it and reloads again, and so on.

    It never happened again since I disabled that option.
     
  37. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    Just updated my project from Unity 2021 (which was very stable) to 2022.3.8f1. Never had so many editor crashes, including my PC just spontaneously restarting on one occasion. As well as freezing on Domain reload, also have to contend with Unity Editor crashing after "failed to present d3d11 swapchain" error message. I'm saving my work every ten minutes at the moment.
     
  38. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I started a new project today 2022.3.9... I have 1 script for basic player movement. No imported assets other than PNGs and whatever Unity added with the "2D Core" package... and the editor is not responding for 6 minutes now, Reloading Domain... I'm like 30 minutes into the project... Have never seen this in my massive main project in 2019...
     
    spacehelmetboy likes this.
  39. progCan

    progCan

    Joined:
    Apr 27, 2021
    Posts:
    7
    does this keep happening every time? if not, just close unity from the task manager, open it back and then it should be solved.
     
  40. Christin2015

    Christin2015

    Joined:
    Dec 1, 2015
    Posts:
    48
    I had to update Rider to the latest version to get rid of it. (Unity 2022.3, Rider 2023.2.1 work)
     
  41. Tgtrasher

    Tgtrasher

    Joined:
    Feb 26, 2021
    Posts:
    1
    I have the same error. And is so frustrating and I will probably change engine.
     
    benglasser and lohanc like this.
  42. thomasvaniseghemSB

    thomasvaniseghemSB

    Joined:
    Sep 15, 2022
    Posts:
    13
    @Unity_Javier Any updates on this? Same story as @bart_artanim. Our workflow has been impacted quite drastically due to this issue, having to force close Unity and reopen everytime there is a change in the code is starting to take it's toll
     
  43. eudendeew

    eudendeew

    Joined:
    Feb 5, 2017
    Posts:
    18
    any update? It seems it could be related to Burst, but I have another project with it and it doesn't have this issue.
    Another suspect would be scriptable object serialization, in the bugged project it alerts me about serialization depth.

    In any case, this looks like a deadlock or multithreaded code falling back to single thread.
     
  44. jonathaniscarroll

    jonathaniscarroll

    Joined:
    Oct 6, 2015
    Posts:
    4
    same issue occuring for me, 2022.3.9f1
     
    webik150 likes this.
  45. euden_one

    euden_one

    Joined:
    Apr 4, 2022
    Posts:
    33
    WTF, even creating a new assembly gets me stuck on "Completing Domain" for one minute! And then when reimporting any script I get stuck on Reloading Domain for 40 seconds.

    I think I fixed it: I had scriptable objects that had classes with [Serializable] which in turn had more [Serializable] in them, when removing the [Serializable] decorator it compiles again as normal.

    On Unity 2022.3.2f1 haven't tried in more recent versions.

    UPDATE: I had a script in a prefab, that inside class a [Serializable] class (Let's call it "class Data") that had inside a private List<Data>, either deleting the prefab that uses "Data" or removing the List bring compilation back to normal speeds.
     
    Last edited: Oct 8, 2023
  46. thomasvaniseghemSB

    thomasvaniseghemSB

    Joined:
    Sep 15, 2022
    Posts:
    13
    Confirmed this to be a problem on both Windows 11 and MacOS. I can reproduce quite consistently by attaching a debugger in VSCode. When no debugger is attached, no problems arise. Project I'm working on is way to big to pinpoint an exact cause like @euden_one mentioned above here.
     
    gooby429 likes this.
  47. benjamin_thegoodevil

    benjamin_thegoodevil

    Joined:
    Aug 5, 2020
    Posts:
    20
    Had the issue in one of our older projects too.
    The project was running on a 2019.3.x version of unity with assetdatabase v1.
    First I upgraded the version to 2019.4.40 which triggered a rebuild of the assetdatabase in v2.

    During the opening process of the project in the newer versions a small white window appeared which seemed to block unity. The window turned out to be a git checker window which was attached to unity via the [UnityEditor.Callbacks.DidReloadScripts] attribute. I deactivated the window so it won't try to open during the opening process of unity.

    Guess those two things made a difference since I was now able to open the project in 2021.3.

    I recommend checking whether your project is using assetdatabase v2 already. If not try to upgrade it "slowly". Jumping from 2019.3 to 2022.3 was way to big I guess.
    Also try to remove [UnityEditor.Callbacks.DidReloadScripts] attribute usage if you got that in your project.
     
  48. chase_unity38

    chase_unity38

    Joined:
    Jan 5, 2022
    Posts:
    8
    getting stuck too. unity 2021, 2022, and 2023.
    1. run the game
    2. stop the game
    3. make a code change, recompile
    4. unity gets stuck "Reloading Domain"

    I look at the editor log, unity isn't completely frozen, it's logging the same type of message every second or so:

    Code (CSharp):
    1. Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
    2. Unloading 0 unused Assets / (Unknown). Loaded Objects now: 11253.
    3. Memory consumption went from 8.53 GB to 8.53 GB.
    4. Total: 1026.463000 ms (FindLiveObjects: 0.406583 ms CreateObjectMapping: 0.151875 ms MarkObjects: 1025.896166 ms  DeleteObjects: 0.007625 ms)
    5.  
    6. Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
    7. Unloading 0 unused Assets / (0 B). Loaded Objects now: 11253.
    8. Memory consumption went from 8.53 GB to 8.53 GB.
    9. Total: 1027.794042 ms (FindLiveObjects: 0.485125 ms CreateObjectMapping: 0.152708 ms MarkObjects: 1027.147333 ms  DeleteObjects: 0.008584 ms)
     
  49. harumaron

    harumaron

    Joined:
    Jun 24, 2019
    Posts:
    2
    I found one cause for this problem.
    It was due to the fact that I had not cancelled the server streaming of gRPC.

    The solution is to pass the CancellationToken to the IAsyncStreamReader properly. By canceling at the end of the application, the streaming can be finished successfully.

    See sample code below.
    Note that this is only hypothetical code.
    Code (CSharp):
    1.         public async void Stream(CancellationToken cancellationToken)
    2.         {
    3.             AsyncServerStreamingCall<SomeResponse> streamer = CallInvoker.AsyncServerStreamingCall(SomeRequest, null, options, request);
    4.             IAsyncStreamReader<SomeResponse> streamReader = streamer.ResponseStream;
    5.            
    6.             while (await streamReader.MoveNext(cancellationToken)) //Be sure to pass the CancellationToken.
    7.             {
    8.                
    9.             }
    10.         }
    11.  
     
  50. Snedden27

    Snedden27

    Joined:
    Jul 4, 2020
    Posts:
    8
    Revisiting this as this still happens for me, I have got used to it but I would appreciate if this is solved and I can save time from force-killing the editor and restarting unity. For me it consistently happens when I debug , sometimes the debugger works but when I make a code change then recompile and try to start the game in the editor with debugger on in VS code I get stuck on Reloading Domain and I have to force kill unity,

    i am on 2022.3.6f1(stable) , I am pretty sure this didn't occur in previous older versions
     
    ericpug likes this.