Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Prefabs Missing when upgrading from 2018.3 to 2019.4

Discussion in 'Prefabs' started by Alkanov, Jan 4, 2021.

  1. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    54
    For some reason when upgrading from 2018.3 to 2019.4 I get tons of prefabs missing like described here Bug - REGRESSION: assets that failed to import result in missing prefab that lose the original name - Unity Forum

    I also get compile errors due to some plugins that need to be updated after the engine upgrade, once these errors are solved prefabs are still missing even If I reimport all or delete the Library folder.

    Ive spent quite some time trying to fix this and I found that the .meta files of the scene where the prefab is missing is 100% the same as the one in 2018.3 with a valid guid reference to the prefab. If I delete the missing prefab and drag and drop the prefab again then the .meta file changes, see below:

    Prefab .meta (truncated for better visibility):
    Code (CSharp):
    1. fileFormatVersion: 2
    2. guid: 1dfe7b28f313a8844b1cb402b2739ed3
    3. ScriptedImporter:
    4.   fileIDToRecycleName:
    5.     100000: _MapPrfab/harbour
    6.     100002: _MapPrfab/harbour/Grid
    7.     100004: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls
    8.     100006: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (16,32)
    9.     100008: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (32,0)
    10.     100010: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (32,16)
    11.     100012: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (32,32)
    12.     100014: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (48,0)
    13.     100016: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (48,16)
    14.     100018: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (48,32)
    15.     100020: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (48,48)
    16.     100022: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (64,0)
    17.     100024: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (64,16)
    18.     100026: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (64,32)
    19.     100028: _MapPrfab/harbour/Grid/Bridges/Walls/Trees/Darkness/Waterfalls/Chunk (64,48)

    With missing prefab 2019.4 (notice guid: 1dfe7b28f313a8844b1cb402b2739ed3 is correct but fileID seems to reference childs of the prefab, eg: 100000,400000,etc

    Code (CSharp):
    1. --- !u!1001 &1915161834
    2. PrefabInstance:
    3.   m_ObjectHideFlags: 0
    4.   serializedVersion: 2
    5.   m_Modification:
    6.     m_TransformParent: {fileID: 1821289052}
    7.     m_Modifications:
    8.     - target: {fileID: 100000, guid: 1dfe7b28f313a8844b1cb402b2739ed3, type: 3}
    9.       propertyPath: m_Name
    10.       value: harbour
    11.       objectReference: {fileID: 0}
    12.     - target: {fileID: 100000, guid: 1dfe7b28f313a8844b1cb402b2739ed3, type: 3}
    13.       propertyPath: m_IsActive
    14.       value: 1
    15.       objectReference: {fileID: 0}
    16.     - target: {fileID: 400000, guid: 1dfe7b28f313a8844b1cb402b2739ed3, type: 3}
    17.       propertyPath: m_LocalPosition.x
    18.       value: 0
    19.       objectReference: {fileID: 0}
    20.     - target: {fileID: 400000, guid: 1dfe7b28f313a8844b1cb402b2739ed3, type: 3}
    21.       propertyPath: m_LocalPosition.y
    22.       value: 0
    Now, after I delete the bugged missing prefab and re-drag and drop the original one into the scene, notice FileID is now a negrative big number:

    Code (CSharp):
    1. PrefabInstance:
    2.   m_ObjectHideFlags: 0
    3.   serializedVersion: 2
    4.   m_Modification:
    5.     m_TransformParent: {fileID: 1821289052}
    6.     m_Modifications:
    7.     - target: {fileID: -8754723954883928660, guid: 1dfe7b28f313a8844b1cb402b2739ed3,
    8.         type: 3}
    9.       propertyPath: m_Name
    10.       value: harbour
    11.       objectReference: {fileID: 0}
    12.     - target: {fileID: -8646016225646303417, guid: 1dfe7b28f313a8844b1cb402b2739ed3,
    13.         type: 3}
    14.       propertyPath: m_RootOrder
    15.       value: 0
    16.       objectReference: {fileID: 0}
    17.     - target: {fileID: -8646016225646303417, guid: 1dfe7b28f313a8844b1cb402b2739ed3,
    18.         type: 3}
    19.       propertyPath: m_LocalPosition.x
    20.       value: 0
    21.       objectReference: {fileID: 0}
    22.     - target: {fileID: -8646016225646303417, guid: 1dfe7b28f313a8844b1cb402b2739ed3,
    23.         type: 3}
    24.       propertyPath: m_LocalPosition.y
    25.       value: 0
    26.       objectReference: {fileID: 0}
    It seems like .meta was not migrated during the engine upgrade, possibly due to a compile error

    What is the recommended procedure to follow now?

    Thanks
     
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Hi,

    This is common to happen when script compilation fails and we are trying to find a way to make sure this does not happen. Some work has already been done https://forum.unity.com/threads/addressing-issues-with-missing-references.890923/

    The recommend fix is to handle all compilation issues and then force reimport all prefabs, simply right click in the project browser on prefabs. Might be fastest to type
    t:prefab
    in the search bar and select all prefabs to make sure all are reimported.

    I hope this solved your issue

    Don't try to recreate your prefabs like you mention above, this will change all GUIDs and probably cause even more problems
     
  3. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    54
    This is exactly what I did, but I still end up with these broken prefabs

    What I did was created a copy of the project in 2018.3 upgraded it to 2019.4, fixed all the compilation issues and then pasted those fixes in a fresh copy of the 2018.3 one, opened the project in 2019.4 and upgrade. I had 0 compilation issues but still a bunch of broken prefabs

    Should I attempt 2020.x ?
     
  4. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    54
    Here I managed to recreate the issue:
    • Open the scene in SuperTiled2Unity->Examples->Overhead in 2018.3.12.f1
    • Confirm TestOverhead is seen and close the project
    • Open the same project in 2019.4.17f1
    Reimporting won't fix the problem nor anything else I tried above

    Project: https://we.tl/t-kd2FfFsxYb

    Edit: The same happens from 2018.3.12.f1 to 2020.2 - reported bug under 1303493
     
    Last edited: Jan 4, 2021
  5. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Thanks, I will take a look at the bug
     
  6. Alkanov

    Alkanov

    Joined:
    May 15, 2017
    Posts:
    54
    The same issue happens if you upgrade from 2018.4LTS to 2019+
     
  7. Seanba

    Seanba

    Joined:
    Nov 17, 2012
    Posts:
    33
    FWIW I'm the author of the SuperTiled2Unity plugin and I've been able to reproduce the bug @Alkanov mentions. I've spent some time trying to diagnose but no luck so far. If anyone from Unity has some advice I'm all ears.
     
  8. snixer

    snixer

    Joined:
    Oct 18, 2017
    Posts:
    2
    @SteenLund @Alkanov Did either of you ever figure out how to fix this? Experiencing a very similar thing.
     
  9. sergioabril

    sergioabril

    Joined:
    Jan 11, 2016
    Posts:
    33
    Is there any update on this? I'm migrating an old production project from 2018 to 2019, and It's happening the same. No matter if I migrate to 2019 or 2020, prefabs go missing. What's the correct approach? Reimporting doesn't seem to fix the issue.

    @SteenLund @Alkanov