Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug (Case 1180690) Assertion failed on expression: 'txn.Exists(guid)'

Discussion in '2019.3 Beta' started by Peter77, Aug 31, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,571
    Focusing the Unity Editor, causes the following error:
    Code (CSharp):
    1. AssertImplementation
    2. VerifyGuidPMRegistrations
    3. RefreshInternalV2
    4. StopAssetImportingV2
    5. RefreshV2
    6. AssetDatabase::Refresh
    upload_2019-8-31_7-36-49.png

    Reproduce
    • Create new project (3D template)
    • Open Microsoft Notepad
    • Switch between Unity Editor and Microsoft Notepad

    Actual
    Observe Unity Editor outputs an error every time it receives the focus.

    Expected
    No error.
     
    rakkarage likes this.
  2. decimate_3d

    decimate_3d

    Joined:
    Sep 24, 2011
    Posts:
    15
    I'm getting these errors in 2019.3.0b1 when creating a new project. They appear immediately after creating a new project (3D template). On a Mac here.

    Assertion failed on expression: 'txn.Exists(guid)'
    Assertion failed on expression: 'false'

    The editor layout could not be fully loaded, this can happen when the layout contains EditorWindows not available in this project
    UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
     
    Orbiter197 and rakkarage like this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,571
    rakkarage, Rallix and decimate_3d like this.
  4. cassidycurtis

    cassidycurtis

    Joined:
    Apr 8, 2019
    Posts:
    6
    For what it's worth, there seems to be a workaround. If you quit Unity, and then open Visual Studio (or VS Code) with some of your project files before restarting Unity, the assertion failure errors go away. (I can only confirm that this works with 2019.3.0b1, so YMMV.)
     
    johnroodt likes this.
  5. Psyboyo

    Psyboyo

    Joined:
    May 16, 2017
    Posts:
    4
    Confirmed, if you leave Visual Studio open and restart Unity, no errors show up.
     
  6. raimis001

    raimis001

    Joined:
    Jan 20, 2015
    Posts:
    3
    In Unity 2020.1.05a same - if open Unity vith opened VS appear errors

    Assertion failed on expression: 'txn.Exists(guid)'
    Assertion failed on expression: 'false'

    If close all VS instances and open Unity, no errors show up.
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,127
    Peter77 likes this.
  8. conceptfac

    conceptfac

    Joined:
    Feb 15, 2018
    Posts:
    23
    Same issue on 2019.3.0b4
     
    Chuk_iGek likes this.
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,127
    The fix will most likely be in b7.
     
  10. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Still happening on 2019.3.0b11.
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,127
    Are you able to reproduce the behaviour consistently? The fix went into b7 and was verified against the available reproduction steps. If this continues to be an issue for you, a bug report with reproduction steps would be much appreciated.
     
  12. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    I wasn't able to repro in a fresh project but I recorded a video of it happening in 2019.3.0b11:



    It seems this starts happening when
    • working in a project (no error)
    • creating a git branch with some new assets (meshes / textures / scripts / prefabs / scenes / asmdefs ...)
    • switching back to the master branch
    • opening Unity again.
    • this even results in complete crashes on first open sometimes, I also saw messages about "library is corrupted, please do a reimport" which went away on 2nd try
    • and it results in those serialization issues.
    • So my assumption is that AssetDatabase v2 caches stuff incorrectly that is actually gone but is not able to properly clean itself from those assets that "suddenly" went missing again (when switching back to master branch).
    I'll try reproducing but I'm not sure this even happens in "simple" projects.

    EDIT: So I tried running AssetDatabase.ForceReserializeAssets on the affected project and it seems to log the above error message for every asset, multiple times - note the 220.000 errors after running this command:

    upload_2019-12-4_15-57-53.png
     
    Last edited: Dec 4, 2019
  13. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    The error comes out of a number of internal Unity methods.
    upload_2019-12-4_16-7-42.png
     
  14. charlesb_rm

    charlesb_rm

    Joined:
    Jan 18, 2017
    Posts:
    485
    What version of the editor are you using? This was fixed in 2019.3.0b7.
     
  15. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    As written above the video: I recorded a video of it happening in 2019.3.0b11.
    Some additional context here, sorry for the mix of threads.
     
  16. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,914
    Came here top hit from Google ... seems to be the same bug present in 2019.3.5 (!).

    Reading @fherbst's post, I think I know what happend for me:

    1. Working on a networked multiplayer project based off Unity's own networking (although now using one of the community ports, because of course Unity killed theirs off)
    2. ...so (by design) need to have two copies of the Editor open with the same source: one to test client builds, one to test server builds (otherwse you simply can't do multiplayer development; the whole Play mode would be useless, since Unity only allows you to run one instance of Play mode at a time)
    3. Used the common trick of symlinking one of the script folders between two projects, so they have exactly the same source (for that folder only! Each of them has fully seaprate other folders, and 99% seaprate Assets folders)

    ...and then I did a "git commit" from one project, and tabbed back to the other project, and got hit with this:

    "Assertion failed on expression: 'insideBlock || node.IsInline() || node.IsScalar()'
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()"

    Now ... I understand that Unity officially doesn't support symlinking folders (although that's a bit embarassing: it's a core OS feature, not some weird thing to be ignored!), but I don't think AssetDatabasev2 should be collapsing on this. Not least because of how important/common the technique is for networking developers (from years before Unity).
     
  17. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Just happened to me on 2019.4.1. It happens when trying to save a scene.

    upload_2020-6-29_19-12-12.png
     
  18. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,127
    Could you please submit a bug report for this issue with a reproduction project?
     
  19. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I am not really sure how to reproduce it as I only saw it one time. I just restarted the editor and it is not happening any more. I will if I see it again.
     
  20. jacasch

    jacasch

    Joined:
    Jan 20, 2017
    Posts:
    16
    We are getting this error as well in our project. (2020.3)

    Code (CSharp):
    1. Assertion failed on expression: 'insideBlock || node.IsInline() || node.IsScalar()'
    2. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
     
  21. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,914
    If you can reproduce it reliably in that project ... Submit a bug, and copy/paste the Tracker link for it here so others can see it's submitted (and follow progress on a fix!)