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 Fatal error - data stream is corrupt

Discussion in 'Editor & General Support' started by Cheo6, Feb 5, 2023.

  1. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    22
    Hello, I'm having a really big issue in my current project. In order to upgrade a too large project from 2022.1 to 2022.2 I created a new project in 2022.2 into which I copied many folders from the 2022.1 one. Things were okay at first, but I quickly stumbled upon a fatal error window saying : "Fatal error ! InputStream uses a type without including its layout information (type tree): data stream is corrupt !". This error would often occur when starting play mode. And today it happened again and crashed the project as usual, but when I reopened it I got the same error message on startup on the same scene !
    I decided to update to 2022.2.5, it seemed intially okay, but when duplicating the scene with the startup crash and opening it I got a similar error message once the scene was opened : "Fatal error! Input stream uses a type without including its layout information (type tree): data stream is corrupt ! UnityEngine.GUIUtility.ProcessEvent (int,intptr, bool)".
    This is really worrying, does someone have an idea what might cause this error, and what the tree thing might be ? Could it be about online storage or Behavior Designer's trees ? I might add that the bugged scene is my heaviest so far, with many Adventure Creator and Ultimate Character Controller components scattered all aroud.

    Edit : Forgot to mention I deleted the library folder which was recreated on update, that fixed nothing unfortunately.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Then start repeatedly bisecting that scene util you find out exactly what is unhappy inside of it.

    You are using source control, correct?? Traditionally one would NEVER contemplate a potentially disastrous change like upgrading to a non-LTS version of Unity without having everything under source control so you can trivially bactrack and/or isolate and bisect for issues.
     
  3. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    22
    The version control package was installed in my project, however I wasn't using it (guess I really should be though). I still have an earlier version of the bugged scene, and if it occurs again anywhere else I'll try removing everything step by step to see if I can find the culprit.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    I would NOT use the in-build PlasticSCM/Collaborate package. In 2023 there are far superior options available for free. It is never too late to get 100% of your project under source control, especially before a massive upgrade, one that is already causing issues.

    I'm sorry you've had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    I usually make a separate repository for each game, but I have some repositories with a bunch of smaller test games.

    Here is how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    If you plan on joining the software industry, you will be required and expected to know how to use source control.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards

    ISSUES RELATED TO UPGRADING PROJECTS (eg, using a later Unity version)

    Upgrading to a later version of Unity is a one-way process. Any project that has been updated should NEVER be reverted to an earlier version of Unity because this is expressly not supported by Unity. Doing so exposes your project to internal inconsistencies and breakage that may actually be impossible to repair.

    IF you want to upgrade to a newer version of Unity, do not even consider it until you have placed your project fully under proper source control. This goes double or triple for non-LTS (Tech Stream) versions, which can be extremely unstable compared with LTS.

    Once you have source-controlled the project then you can attempt a Unity upgrade. Immediately after any attempted upgrade you should try to view as much of your project as possible, with a mind to looking for broken animations or materials or any other scripting errors or runtime issues.

    If there are issues in your testing, ABANDON the upgrade, revert your project in source control and be back where you were pre-upgrade.

    Obviously the less you test after the upgrade the more chance you will have of an undiscovered critical issue.

    This risk of upgrading is entirely on you and must be considered whenever you contemplate a Unity version upgrade.

    Do not upgrade "just for fun" or you may become very unhappy.
     
    Last edited: Feb 5, 2023
  5. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    22
    Wow, thank you for all these details ! I'll be sure to take the time to learn more about GitHub.