Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Help corrupt Terrain from Git: "Unknown error occurred while loading 'Assets/Terrain/Terrain_0_5.."

Discussion in 'Editor & General Support' started by snipeorigin, Aug 10, 2020.

  1. snipeorigin

    snipeorigin

    Joined:
    Apr 3, 2014
    Posts:
    3
    Hello,

    first time seeking support directly. Usually I find my answers online but this seems too specific. I have a Terrain I am working on my Main PC. It's working and loading fine.
    I do update unity and packages regularly (I'm on Unity 2020.1.0 rn) - Terrain Tools 3.0.1 preview from the Package Manager.

    One day when commiting me Terrain to my Git and checking the Work on my Laptop, after pulling from git, I got this Error:
    "Unknown error occurred while loading 'Assets/Terrain/Terrain_0_0_5f153c60-6e59-434b-af76-bf0d78376183.asset'.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)"

    upload_2020-8-10_11-17-40.png
    Basically describing, that my TerrainData is corrupted.

    I do still have my work on my main machine but I don't know how to transfer Terrain Data via git without having this happening.

    Help would be apprechiated!

    Greetings
    Zacharias
     
  2. momisrabi

    momisrabi

    Joined:
    Apr 30, 2022
    Posts:
    1
    Bump, same here
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    Everything you do against git SHOULD be done with Unity actually closed. It's possible something about your terrain data was being written / read when it was committed, which could lead to any random invalid internal state.

    If you were using a drive mirroring service (Google Drive, Dropbox, etc.) those are also not supported.

    If you have the data on another machine, make an actual backup of the affected files, then completely remove them from git, commit the removal, then re-add them.

    Here's more reading:

    PROPERLY CONFIGURING AND USING ENTERPRISE SOURCE CONTROL

    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 the ONLY folders you should ever source control are:

    Assets/
    ProjectSettings/
    Packages/

    NEVER source control Library/ or Temp/ or Logs/
    NEVER source control anything from Visual Studio (.vs, .csproj, none of that noise)

    Setting git up with Unity (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