Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Warning Unity 2022.2 beta install corrupts other solutions when it crashes.

Discussion in '2021.2 Beta' started by cecilcruxis, Jun 24, 2021.

  1. cecilcruxis

    cecilcruxis

    Joined:
    Sep 17, 2013
    Posts:
    116
    I was working on a unity project with the new beta of Unity. When my Unity crashed I reopened it and all my scenes were corrupted. I figured it was some kind of issues in the beta. I started getting errors in Unity. It said Unity scenes were instead binary files. I got other errors for some reason pointing to entire different projects. .Net core blazor projects in a different folder. Other solutions I opened that are .net core projects for web servicers nothing had to do with unity had files turn into some of the images attached. Can someone at Unity explain to me how your cache package files suddenly started effecting other solutions. Turning my cs files into binary and corrupting them. Second image below shows what one of my razor files got turned into. Why did unity edit a razor file in a different solution? Why is Unity files referenced in different solutions assemblies corrupting them in ways I don't even know how?

    Edit

    Looks like the folder somehow got corrupted on crash. Still going through everything, but seems like a issue with visual studios connecting with Unity during a crash. I was debugging the project when it happened. Somehow multiple visual studios solutions got messed up. Due note i had two different instances of visual studio up on two different screens. One with the .net core and one with unity. Still going through everything and will update later.

    Binary.PNG Unity Corruption.PNG Unity Install File.PNG Unity Corruption.PNG
     
    Last edited: Jun 24, 2021
  2. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    641
    I've mentioned this many times in the past, but basically when Unity crashes, and it certainly will, it will often break something. I've had issues like layers stop working, a certain scene just broken (saving the scene as a new scene fixed it) and etc. The point is when it crashes, it is going to take break something. Period. That has been the case since Unity 5. This is not just this specific Beta's issue.

    Always keep a back up (make one every week, keep at least 6 months of it) and make backups before making big changes to the project (like adding in a new system) and remember to save and close the project before doing it. If Editor crashes after you make changes, and saved but not closed, the same corruption may occur. Before doing something important, just save and close the editor and reopen.
     
  3. cecilcruxis

    cecilcruxis

    Joined:
    Sep 17, 2013
    Posts:
    116
    Was hoping visual studios auto recovery system that saves files could be used to get the data back, but nope no back up was auto save. It is okay though I just got to type it again no big deal. I just want people to know there is an issues and I want to see if there is a way to fix it. Hope it was maybe an accidental corruption somehow.
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    27,805
    But that's absolutely not the case unless you're doing stuff like saving with your own code. The reason for this is Unity only operates on a copy of the scene when in play mode, and only saves any data at all, if you tell it. So if it loses data somehow, it is because it was actually saving data at the time.

    I've never had this behaviour happen to me, but then I'm not saving anything at time of crash so it's worth investigating more.
     
    GliderGuy and jjejj87 like this.
  5. cecilcruxis

    cecilcruxis

    Joined:
    Sep 17, 2013
    Posts:
    116
    Well it looks like somehow the index of the SSD drive messed up badly switching location of files in the partion.

    Not sure if this is a Unity connecting to Visual Studios thing. My thought is when it crashed I was finishing debuggin and connected to Visual Studios straight afterward I saved the project. After checking all the folders and trying to recover them I found them just not in the right directory. Fun little bug. No idea if this is Unity, Visual Studios, or a freak save thing being written to the SSD. This only effected my projects in visual studio.

    I updated my original post. I will keep this thread just in case someone else runs into this freak accident. I doubt it will because of the specific circumstances, but man is it a headache.
     
    Last edited: Jun 24, 2021
    GliderGuy likes this.
  6. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    641
    Theoretically yes, but as the project size grows, you will see wonderful things happen :)
     
    GliderGuy likes this.
unityunity