Can't open project after renaming variable in Custom Action

I have a bug that is preventing me from opening my project. I was editing a custom action to include an additional variable using my IDE. Afterwards, I noticed that there was a way to do it in the editor. So when I corrected it in the editor it had a duplicate variable name. I went on to delete the duplicate, and then tried to change the name of the class (in the IDE). At that point Unity threw a fatal error and will not reopen the project. The error is:

Input stream uses a type without including its layout information (type tree): data stream is corrupt!
UnityEditor.AssetDatabase:LoadAllAssetsAtPath (string)
Unity.Behavior.BehaviorAuthoringGraph:EnsureAssetHasBlackboard () (at ./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs:417)
Unity.Behavior.GraphFramework.GraphAsset:OnEnable () (at ./Library/PackageCache/com.unity.behavior/Tools/Graph/Asset/GraphAsset.cs:99)

I deleted the custom action and even the referencing behavior tree, but I am still unable to open the project even with deleting and rebuilding Library.

Full trace:

Input stream uses a type without including its layout information (type tree): data stream is corrupt!
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEditor.AssetDatabase:LoadAllAssetsAtPath (string)
Unity.Behavior.BehaviorAuthoringGraph:EnsureAssetHasBlackboard () (at ./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs:417)
Unity.Behavior.BehaviorGraphEditor:Load (Unity.Behavior.GraphFramework.GraphAsset) (at ./Library/PackageCache/com.unity.behavior/Authoring/UI/AssetEditor/BehaviorGraphEditor.cs:107)
Unity.Behavior.BehaviorWindow:OnEnable () (at ./Library/PackageCache/com.unity.behavior/Editor/Windows/BehaviorWindow.cs:54)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget (string)
UnityEditor.WindowLayout:LoadWindowLayout (string,UnityEditor.WindowLayout/LoadWindowLayoutFlags)
UnityEditor.WindowLayout:LoadWindowLayout (string,bool,bool,bool,bool)
UnityEditor.WindowLayout:LoadLastUsedLayoutForCurrentMode (bool)
UnityEditor.WindowLayout:LoadCurrentModeLayout (bool)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences ()

[./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs line 417]

Full dialog message :

Input stream uses a type without including its layout information (type tree): data stream is corrupt!
UnityEditor.AssetDatabase:LoadAllAssetsAtPath (string)
Unity.Behavior.BehaviorAuthoringGraph:EnsureAssetHasBlackboard () (at ./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs:417)
Unity.Behavior.BehaviorGraphEditor:Load (Unity.Behavior.GraphFramework.GraphAsset) (at ./Library/PackageCache/com.unity.behavior/Authoring/UI/AssetEditor/BehaviorGraphEditor.cs:107)
Unity.Behavior.BehaviorWindow:OnEnable () (at ./Library/PackageCache/com.unity.behavior/Editor/Windows/BehaviorWindow.cs:54)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget (string)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences ()

UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEditor.AssetDatabase:LoadAllAssetsAtPath (string)
Unity.Behavior.BehaviorAuthoringGraph:EnsureAssetHasBlackboard () (at ./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs:417)
Unity.Behavior.BehaviorGraphEditor:Load (Unity.Behavior.GraphFramework.GraphAsset) (at ./Library/PackageCache/com.unity.behavior/Authoring/UI/AssetEditor/BehaviorGraphEditor.cs:107)
Unity.Behavior.BehaviorWindow:OnEnable () (at ./Library/PackageCache/com.unity.behavior/Editor/Windows/BehaviorWindow.cs:54)
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget (string)
UnityEditor.WindowLayout:LoadWindowLayout (string,UnityEditor.WindowLayout/LoadWindowLayoutFlags)
UnityEditor.WindowLayout:LoadWindowLayout (string,bool,bool,bool,bool)
UnityEditor.WindowLayout:LoadLastUsedLayoutForCurrentMode (bool)
UnityEditor.WindowLayout:LoadCurrentModeLayout (bool)
UnityEditor.WindowLayout:LoadDefaultWindowPreferences ()

[./Library/PackageCache/com.unity.behavior/Authoring/Asset/BehaviorAuthoringGraph.cs line 417]

Hi @JRRReynolds

It’s hard to help with the given information. Do you use source control? Could you delete the graph asset and then revert the deletion?

For now the priority is to be able to reopen the editor, I would suggest to make a backup of the graph and then deleting it from you project. Once you have access to the editor, try to reimport the graph.

If this is possible, and the graph is still corrupted, try deleting Runtime Asset.
If this is not an option or not working, you will have to redo the graph from scratch unfortunately :slightly_frowning_face:

Could you provide repro steps for the issue? I believe this is the first time this issue is reported. Currently my understanding is:

  1. Create a custom action node
  2. Add a new variable field from code IDE
  3. In the behavior graph, select the custom node and use the node wizard to edit it’s definition
  4. Add the same variable from the editor
  5. Fatal-Error happening (?)

Can you confirm the repro? Is there anything else to look for?

Also, what are your package and Unity versions?

Thanks

I got mostly to the bottom of this. [Unity Version: 6000.0.27f1, Behavior Version: 1.0.6]

Related to the problem above, I’ve been having a few problems with crashes and Behavior Trees. At some point my behavior tree became somewhat corrupt. I couldn’t rename it or it would crash the editor.

I tracked down the issue to an editor setting: Project Settings → Editor → Asset Serialization. My project had this set to Mixed (Default is Force Text). If I create a brand new project and change this setting to Mixed and import my corrupt behavior tree – it will crash unity editor. If I change my current problematic project to Force Text, it will not crash the editor.

Additionally, if I change a project to Mixed and the editor crashes, even if I change it back to Force Text, it will keep crashing until I delete the Library folder.

Anyway seems like I had a bit of bad luck, because if I have it as mixed and create a new behavior tree, I don’t have any such issues – it just seems like my original behavior tree was corrupted in some manner.

I’d be happy to provide the corrupted behavior tree graph if you would like to look at it. It will reliably crash a brand new project with only Behavior imported. All you would do is change Asset Serialization mode to Mixed, then rename the behavior tree twice (I just added an ‘a’ at the end twice). The second time it crashes the project.

1 Like

Wow ok that was unexpected, thanks for the additional info!

Could you open a bug report with the same information you provided here + the corrupted asset? Customer QAs will do the first pass of test and they will dispatch the bug to the appropriate team.

Many thanks for your time :+1:

Thanks for looking into it! Submitted it just now.

1 Like