Search Unity

Objects are trying to be loaded during a domain backup.

Discussion in 'Editor & General Support' started by LootlabGames, Apr 8, 2022.

  1. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    I just upgraded from 2020.3.30f1 to 2020.3.33f1 and now I get this error:

    Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!

    The game still runs but I'm not sure why I am getting this error.

    Anyone else run into this?
    upload_2022-4-8_11-53-38.png
     
    SametJR, xucian, ChiuanWei and 6 others like this.
  2. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yeah I got the same 4 errors in a row after updating from 2021.2.9 to 2021.2.18. Someone at Unity made a whoopsie...

    To fix this you'll probably have to delete your Library folder and reopen (meaning a lengthy reparse of) the entire project. That's how I fixed it on my end.
     
  3. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    Ok, thanks for your reply.
     
    dyhmichail, JonathanBartel and Seith like this.
  4. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    Ok well I did try deleting my library and let Unity rebuild it. But I am still have the same issue. It was worth a try I guess.
     
  5. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    You're right, I can confirm that rebuilding the library will only fix the issue for a while but the errors come back.

    Now we can only hope there's someone at Unity able (or willing) to fix this. *sigh*
     
  6. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Same problem here. Sad we don't have a more detailled log.
     
    dyhmichail likes this.
  7. AngelSiendones

    AngelSiendones

    Joined:
    Mar 19, 2020
    Posts:
    3
    Same problem here, after upgrading from 2020.3.30f1 to 2020.3.32f1. It happens to everyone in my company that also upgraded.
     
    dyhmichail likes this.
  8. dyhmichail

    dyhmichail

    Joined:
    Jan 16, 2016
    Posts:
    16
    I have the same issue. It called by Odin Serializer.
     
  9. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    If you're getting this from the Odin plugin they have a hotfix available to remedy this. Should be able to ask for it in their Discord group.
     
    LootlabGames, Birlouz and BogdanDude like this.
  10. SunnysideGames

    SunnysideGames

    Joined:
    May 14, 2014
    Posts:
    25
    Same issue, I found out that deleting all assets of a custom ScriptableObject class resulted in less error messages. I'm wondering if it's because of some AssetDatabase or Resources loading instructions which are called from OnBeforeSerialization.

    The good point is that Unity doesn't crashes anymore (well almost), so maybe this error is Unity telling us it prevented some unsafe code from executing ?
     
    MehdiZarei likes this.
  11. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Just upgraded to 2021.3 LTS, got the same thing, but no useful information to what is causing it.
     
    JKort and pragmascript like this.
  12. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    Are you using Odin Inspector at all?

    Otherwise the issue they discovered was that in some versions of Unity, not others, calling the prefab API during serialisation is a no go and throwing this error.
     
    beard-or-die likes this.
  13. ElliotB

    ElliotB

    Joined:
    Aug 11, 2013
    Posts:
    287
    I just upgraded to the recent 2020 LTS and am now getting this on 2020.3.33f1, not using Odin Inspector. Log just spams:
    Code (csharp):
    1. Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!
    2.  
    3. UnityEditor.Graphing.GraphObject:OnBeforeSerialize ()
     
  14. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    I'm using odin inspector and got it after updating to 2021.3LTS so there's definitely something wrong here
     
  15. Faahhx

    Faahhx

    Joined:
    Mar 4, 2015
    Posts:
    12
    Same here.
     
  16. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    A fix for this in Odin Inspector is on its way to the Asset Store, we're just waiting for it to get approved. It's available for download on the website now though.
     
    MarshallVisions likes this.
  17. luvcraft

    luvcraft

    Joined:
    Aug 22, 2011
    Posts:
    76
    I'm having this problem in something other than Odin Inspector. Can you please tell me what the fix is so I can apply it to my code? Thanks!
     
    X2DGmDev likes this.
  18. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    I was not the one who did the fix, but reading off the changelog :p:

    I think it was because ISerializationCallbackReciever was getting hit during an AssemblyReload event where utilizing the Prefab API (and various other API's I Imagine) is now illegal. So the fix was to detect an assembly reload was occurring, and not do the prefab stuff in such cases.
     
    aRD-, Reisender and MarshallVisions like this.
  19. gamedev1506

    gamedev1506

    Joined:
    Nov 2, 2019
    Posts:
    36
    As a LTS the quality is terrible, i'm having all kinds of small bugs and i'm too busy to search all of them or open a bug report.

    Unity team should really rethink this LTS releases, i already regret having updated my project, 2020.3 was way too stable and less buggy.

    I'm getting this same messages, but i'm not using anything serialization related, this 100% a editor bug:
    "Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!

    UnityEditor.Graphing.GraphObject:OnBeforeSerialize ()"
     
    Kokowolo, Sphax84 and imh3ro like this.
  20. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    The fun part is the trailer stating "stability proven" and then getting 2 crashes just renaming folders.

    Regarding the topic, Odin Inspector just got the 3.0.13 update (on the store) with the fix for this issue.
     
    X2DGmDev, gamedev1506 and bjarkeck like this.
  21. rogodoy

    rogodoy

    Joined:
    Jan 24, 2013
    Posts:
    21
    I did a fix by deleting Shadergraph in package manager Im my case it was in Shader graph, may to fix this is just compile your shadergraph files into a normal shader and after delete shadergraph maybe is a bug in shadergraph. This worked for me, I am using 2021.3.0f1
     
  22. Blade_Master_2020

    Blade_Master_2020

    Joined:
    Aug 3, 2019
    Posts:
    38
    The "Remove" button of the Shader Graph in package manager is in gray color and cannot be clicked.
     
  23. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Yes, using Odin, even after updating Odin for the latest fix, I am still getting this error.
     
  24. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    2021.3? what RP? URP, HDRP or legacy (as a previous user mentioned Shader Graph)?
     
    Natzke likes this.
  25. SirCrazyNugget

    SirCrazyNugget

    Joined:
    Jan 6, 2014
    Posts:
    6
    Closing the ShaderGraph window has removed the error for me (at least temporarily).
     
  26. Tyler_Hurdle

    Tyler_Hurdle

    Joined:
    Aug 16, 2014
    Posts:
    2
    To anyone approaching this issue and trying the above solutions:

    My solution to fix the error was an extremely small mistake I missed in a custom script.
    I discovered I placed the Update[ ] portion of the script before the Start [ ] portion.
    Reversing the two and placing Start [ ] in its usual first position fixed the issue.

    Hopefully everyone else has the same easy fix I did. If not, then good luck. ^_^
     
  27. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    I can safety say that will have zero effect on this issue at hand. How you order Unity messages in a script file, and in fact how you order any of your method declarations in a class/struct won't have an effect on anything besides maybe Reflection based matters.
     
  28. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    The order of functions in your source doesn't make any difference in C#.

    - - -

    I'm getting the issue as well, and can confirm that in my case it's because I'm calling PrefabUtility stuff in OnBeforeDeserialize(), i.e. as a part of ISerializationCallbackReceiver.
     
    SunnysideGames likes this.
  29. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I should expand on that. It was definitely the cause of at least some of the errors. Unfortunately they don't all have a stack trace associated with them, and there are remaining cases I've not yet found the cause of.
     
  30. Peeling

    Peeling

    Joined:
    Nov 10, 2013
    Posts:
    443
    For me it was launching the game with a shadergraph editor window open. (2021.2.17f1)

    Anecdotally, the shadergraph window has crashed Unity more times in the few months I've been using it than all other causes in the last decade put together.
     
  31. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Was that causing the ones without stacktraces, or just in general?
     
  32. Peeling

    Peeling

    Joined:
    Nov 10, 2013
    Posts:
    443
    There was no detailed stacktrace, but it did mention shadergraph in a line under the error message. If I can get it to happen again I'll make a note of the details. Closing the shadergraph window stopped all the errors.
     
  33. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    latest LTS is buggy
     
    DavidQi1970 and Vaupell like this.
  34. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Yep, same here latest LTS 2021, and not using Odin :D
     
    X2DGmDev and Skotrap7 like this.
  35. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I have the same bug. I'm using Unity 2021.3.1f1. :(


    Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!

    UnityEditor.Graphing.GraphObject:OnBeforeSerialize ()
     
  36. duckSPLASH

    duckSPLASH

    Joined:
    Jul 11, 2020
    Posts:
    14
    yay me too.

    2021.3.1f1

    No odin.
     
    Skotrap7, Radivarig and Bordeaux_Fox like this.
  37. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    Same here with 2020.3.33f1 LTS, hundreds of error messages in my project that I need to clear all the time.When I doubleclick on the error it takes me to an OnBeforeSerialize() event in the code.

    Sounds real easy to fix, any chance anyone at Unity Technologies can take notice at least? We're talking about a LTS version...
     
    Bordeaux_Fox likes this.
  38. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Yes, this is the most shocking part. These bugs appear in a LTS version of Unity. I choose this version for a new project just to find out it still spams bugs. Very very annoying and unsatisfying to work with ... :(
     
    Skotrap7 likes this.
  39. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Just ran into this today after I deleted some FBX files containing animations that I decided not to use. Deleted maybe 15 files hit play and bam.

    I'm using git, so closed the editor, then I git reset to head (undoing the delete), reopened editor and no issues.

    I also tried deleting the files with the editor closed and manually from disk but alas reopening the editor and hitting play brought them back.
     
  40. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    I just went through these files 1 at a time hitting play each time I deleted 1 and I worked it down to 3 specific FBX files which are somehow causing this issue for me. I can move them within the project, but if I delete them, blamo. /shrug
     
  41. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    The thing is, my project generates meshes at runtime, so I have no fbx files in my project at all. So this might be not the main reason why this bug happens.
     
  42. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    in my case clicking on the error takes me straight to the "culprit" script (simply happens because there is an ObBeforeSerialize event).

    I rolled back to 2020.3.30 until this is solved. Great LTS support, Unity! ;)
     
  43. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Seems to be solved in Unity 2021.3.3f1
     
    MuntyMcFly likes this.
  44. HenryJones14

    HenryJones14

    Joined:
    Jan 13, 2018
    Posts:
    8
    So I am using Unity 2020.3.33f1 and found that I got this error because of an open shader graph window on my second monitor. I'm 99% sure this wont help any of you but I fixed it by closing and reopening the window.
     
  45. Mahunreah

    Mahunreah

    Joined:
    Mar 1, 2018
    Posts:
    14
    Have been using 2020.3.0f1 until now and suddenly got the error (four times in a row at that) after opening a Shadergraph window one time. Closed the window, error stayed. Opened a VFXGraph Window, error stayed. Closed all windows, error stays the same. Restarted Unity, nothing changed. Restarted the PC - same result. Installed 2020.3.3f1, opened the project in there, did not touch any Shader Graph windows - erros greeted me again. Tried again with opening windows, closing windows, restarting Unity as well as restarting the PC, nothing changed, erros kept staying there. I do not use Odin in this project and I am out of ideas by now.

    Update: Got it to work (somewhat) again thanks to a friend. Went to Edit->Project Settings->Editor and enabled Enter Play Mode Settings->Enter play Mode Options. The two below that stayed toggled off. It works now as long as I keep this enabled.

    Update2: Nope, suddenly those bugs just multiply while in Editor mode. I can start the game without errors, though?
     
    Last edited: Jun 1, 2022
  46. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Can we have a statement from Unity if this bug is fixed and if so, which version?
     
  47. eddyrc7

    eddyrc7

    Joined:
    May 19, 2021
    Posts:
    4
    100% I'm rolling back to 2020 LTS.
     
  48. rafaelbarretobra

    rafaelbarretobra

    Joined:
    Aug 5, 2015
    Posts:
    11
    upload_2022-6-4_12-36-31.png
     
    eddyrc7 and Gooren like this.
  49. alti

    alti

    Joined:
    Jan 8, 2014
    Posts:
    94
    Yeah I'm having this problem too. The solution is to switch to unreal.
     
  50. MarcGFJ

    MarcGFJ

    Joined:
    May 16, 2019
    Posts:
    24
    Having the issue too in 2021.2.19f1, all without stack trace. It would be nice to get stack traces.