Objects are trying to be loaded during a domain backup.

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?

9 Likes

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.

4 Likes

Ok, thanks for your reply.

3 Likes

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.

4 Likes

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

5 Likes

Same problem here. Sad we don’t have a more detailled log.

1 Like

Same problem here, after upgrading from 2020.3.30f1 to 2020.3.32f1. It happens to everyone in my company that also upgraded.

1 Like

I have the same issue. It called by Odin Serializer.

4 Likes

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.

3 Likes

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 ?

1 Like

Just upgraded to 2021.3 LTS, got the same thing, but no useful information to what is causing it.

2 Likes

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.

1 Like

I just upgraded to the recent 2020 LTS and am now getting this on 2020.3.33f1, not using Odin Inspector. Log just spams:

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 ()

I’m using odin inspector and got it after updating to 2021.3LTS so there’s definitely something wrong here

Same here.

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.

1 Like

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!

1 Like

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.

3 Likes

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 ()"

3 Likes

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.

3 Likes