Search Unity

ProBuilder 4.0.2 Update Error: ArgumentException: Arg_InsufficientSpace

Discussion in 'World Building' started by zripgud, Jan 24, 2019.

  1. zripgud

    zripgud

    Joined:
    May 10, 2018
    Posts:
    4
    Trying to update ProBuilder (Unity version 2018.3.0f2) from version 3.0.9 to 4.0.2 (both from the Package Manager) I get this error (and ProBuilder ends up in a broken state, had to revert to 3.0.9):

    ArgumentException: Arg_InsufficientSpace
    Parameter name: chars
    System.Text.UTF8Encoding.InternalGetChars (System.Byte* bytes, Int32 byteCount, System.Char* chars, Int32 charCount, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:797)
    System.Text.UTF8Encoding.InternalGetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex, System.UInt32& leftOverBits, System.UInt32& leftOverCount, System.Object provider, System.Text.DecoderFallbackBuffer& fallbackBuffer, System.Byte[]& bufferArg, Boolean flush) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:744)
    System.Text.UTF8Encoding+UTF8Decoder.GetChars (System.Byte[] bytes, Int32 byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/UTF8Encoding.cs:1114)
    System.IO.StreamReader.ReadBuffer () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:358)
    System.IO.StreamReader.ReadLine () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:484)
    UnityEngine.ProBuilder.AssetIdRemapUtility.PackageImporter.FileContainsString (System.String path, System.String search) (at Library/PackageCache/com.unity.probuilder@4.0.2/AssetIdRemapUtility/Editor/PackageImporter.cs:81)
    UnityEngine.ProBuilder.AssetIdRemapUtility.PackageImporter.DoesProjectContainDeprecatedGUIDs () (at Library/PackageCache/com.unity.probuilder@4.0.2/AssetIdRemapUtility/Editor/PackageImporter.cs:92)
    UnityEditor.ProBuilder.VersionValidator.ValidateVersion () (at Library/PackageCache/com.unity.probuilder@4.0.2/Editor/EditorCore/VersionValidator.cs:31)
    UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:209)​

    Looks like you are checking every scene and prefab in the project to look for some id strings, but in some cases sr.ReadLine() in FileContainsString(string path, string search) from PackageImporter.cs throws that exception. I made a small editor script that just explores my project using the methods from your code and seems like many of the scenes/prefabs in it go through without a problem but in some instances this error pops up (the first one is a scene from an asset from the store, that has multiple scenes but only that one gives an error), but can't figure out why (I thought they may contain missing behaviours, something that gave me problems in past ProBuilder updates... but right now I can't find anything different about them).
     
  2. zripgud

    zripgud

    Joined:
    May 10, 2018
    Posts:
    4
    I thought about it a little more and maybe this version's update code is assuming asset serialization is set to force text? That could be the reason readline is generating the error, the code only makes sense for searching text files (or maybe I'm not understanding something)... anyway, if that's the case my project is set to mixed, and I wouldn't want to change that temporarily just to be able to update probuilder every time there's a new version (it's a big project)... so hopefully there will be an update that takes into account every possible type of serialization (again, I may be wrong and it has nothing to do with that).
     
    Last edited: Jan 24, 2019
  3. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    This does sound related to serialization, can you please file a bug report?

    As to requiring switching to "Force Text" for future updates, it is only required for the upgrade to 4.0 and up. Future updates will not require this. After the update you can revert the serialization mode back to mixed or binary.
     
  4. zripgud

    zripgud

    Joined:
    May 10, 2018
    Posts:
    4
    Thanks for the quick reply.

    I switched the project to force text and, although I haven't tested it much, it seems like I was able to update correctly to 4.0.2.

    Do you know of any drawbacks, or benefits, for using force text instead of binary or mixed? I think I remember the project takes more disk space (I didn't check this time before and after to compare) but is more source control friendly when using force text, but other than that I don't know, last time I checked I didn't find much info about the benefits of each choice.
     
  5. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    You've pretty much got it :)

    Here's the manual page, though it doesn't cover much more than you already know.

    https://docs.unity3d.com/Manual/class-EditorManager.html

    Unity uses serialization to load and save Assets and AssetBundles to and from your computer’s hard drive. To help with version control merges, Unity can store Scene files in a text-based format. If you are not merging Scenes, Unity can store Scenes in a more space-efficient binary format, or allow both text and binary Scene files to exist at the same time.​
     
  6. zripgud

    zripgud

    Joined:
    May 10, 2018
    Posts:
    4
    I read that part in the manual some time ago but left me wanting for a little more detail about the pros and cons of each choice, also couldn't find anything much more in depth anywhere else online. I'll probably leave it in force text for now and see if I find any drawbacks as I use it that way.
    Anyway, thanks for the info and for taking the time to reply.
     
    kaarrrllll likes this.