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

Focusing the Unity Editor, causes the following error:

AssertImplementation
VerifyGuidPMRegistrations
RefreshInternalV2
StopAssetImportingV2
RefreshV2
AssetDatabase::Refresh

Screenshot

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.

1 Like

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

2 Likes

QA replied that they are aware of this issue already and the progress can be tracked here:

3 Likes

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

1 Like

Confirmed, if you leave Visual Studio open and restart Unity, no errors show up.

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.

The fix for this issue has landed in 2020.1.0a6 and is on it’s way to 2019.3.

1 Like

Same issue on 2019.3.0b4

1 Like

The fix will most likely be in b7.

Still happening on 2019.3.0b11.

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.

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:

The error comes out of a number of internal Unity methods.

What version of the editor are you using? This was fixed in 2019.3.0b7.

As written above the video: I recorded a video of it happening in 2019.3.0b11.
Some additional context [here]( 2019.3 regressions / bugs that occur often but not sure how to reproduce page-2#post-5247236), sorry for the mix of threads.

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

Just happened to me on 2019.4.1. It happens when trying to save a scene.

6037655--652250--upload_2020-6-29_19-12-12.png

Could you please submit a bug report for this issue with a reproduction project?

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.

We are getting this error as well in our project. (2020.3)

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