Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.4

2019.4

2020.2.2f1

2020.3

2021.1

2021.2

Issue ID

1326120

Regression

No

Unity crashes on GameObject::ActivateAwakeRecursivelyInternal when opening a corrupt Scene

Serialization

-

Reproduction steps:
1. Open the user's attached project
2. Open "Title" scene in Assets/Scenes

Expected result: Scene opens
Actual result: Editor crashes

Reproducible with: 2018.4.34f1, 2019.4.24f1, 2020.3.4f1, 2021.1.3f1, 2021.2.0a13

Notes:
With 2018.4 the crash with the same stack trace occurs when closing the Editor.
With 2021.1 and 2021.2 there is no crash, however, the Title scene is loaded without any assets and there are the following errors in the console:
Error loading the file 'Assets/Scenes/Title.unity'. File has multiple objects with same identifiers. Probably caused by a merge.
Duplicate identifier 1559645088. File: "Assets/Scenes/Title.unity".

Errors when opening the project:
Broken text PPtr in file(Assets/Scenes/Title.unity). Local file identifier (1559645089) doesn't exist!
Unloading 10 Unused Serialized files (Serialized files now loaded: 0)
Assertion failed on expression: 'o != NULL'

Stack trace:
#0 0x0000010ad8e3f4 in GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#1 0x0000010ad8e596 in GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#2 0x0000010ad8e0fe in GameObject::ActivateAwakeRecursively(DeactivateOperation)
#3 0x0000010ad8f04a in GameObject::Activate()
#4 0x00000109d878a5 in DanglingComponentManager::ResolveDanglingComponents()
#5 0x0000010a1450f3 in AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int,

  1. Resolution Note (2021.2.X):

    The scene file in question (Titel.unity) has the same content repeated multiple times, e.g. MonoBehaviour 1559645088 appears at line 2239 and again at 2369. Other objects in that part of the file are repeated. Meanwhile object 1559645089 is referenced from a m_targetGraphic field, but not present in the file. Likely this is the result of a source control merge gone wrong, or other corruption that happened to the yaml file instead of a version of the file that Unity saved. Testing found that the current versions of Unity correctly pinpoint a duplicate object and also dangling object and suggests that it is caused by a merge problem. So while the output is a bit technical and low level, it does pinpoint the problem. If there are any further repro steps available that indicate how to get Unity itself to save a file that cannot be reloaded we will investigate further in that direction.

Comments (1)

  1. CodeBombQuinn

    Aug 11, 2021 20:02

    I also ran into an issue with "File has multiple objects with same identifiers" except with a prefab. The solution for me was:
    1. opening the prefab in a text editor (Sublime Text in my case)
    2. Go through every --- !u!XXX declaration (ex: --- !u!222 &1772883595631061733) search for the ID (in this case 1772883595631061733) to see if there are any other !u!222 declarations of that ID that exist in the same prefab (or scene in your case)
    3. Delete the entire section of duplicate component/object. In my case it was 2 separate instances of RectTransform. So I deleted the entire duplicate section of this:

    --- !u!224 &4143625864393589591 stripped
    RectTransform:
    m_CorrespondingSourceObject: {fileID: 1286656776847131107, guid: 8cbdd27f77aab42888ef9e801572cc81,
    type: 3}
    m_PrefabInstance: {fileID: 2907638985782166196}
    m_PrefabAsset: {fileID: 0}

    4. Save your prefab/scene and try again.

    Btw, if you just try to right-click -> Reimport on the asset that has the issue, keep doing that until there are no errors in the console.

    I hope this helps!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.