Encountered invalid entry while reading serialization data

Issue #526 open
Mark A created an issue

We just upgraded to Odin 2.0.17 (this version isn't selectable below so I've marked it as 2.0.16, but it's .17). I think this error started occurring on update, although I cannot be 100% sure . The component is question hasn't changed since mid March although I'm still trying to track down if a base class did change, although it looks like it did not. This error occurs on startup of the editor and it doesn't seem like it is affecting play in editor mode or our standalone builds.

We do not have editor only mode enabled. Unity 2018.4.6f This is on Windows 10.

Data dump:

Reader type: SerializationNodeDataReader
Data dump: Nodes:

- Name: 
  Entry: 0
  Data: 
- Name:     <<<< READ POSITION
  Entry: 0
  Data: 
- Name: 
  Entry: 6
  Data: 
- Name: frozenDamageReactions
  Entry: 6
  Data:

UnityEngine.Debug:LogError(Object) Sirenix.Serialization.CustomLogger:LogError(String) (at C:/Projects/sirenix-development-framework/Sirenix Solution/Sirenix.Serialization.Config/CustomLogger.cs:59) Sirenix.Serialization.DebugContext:LogError(String) (at C:/Projects/sirenix-development-framework/OdinSerializer/OdinSerializer/Core/Misc/SerializationConfig.cs:208) Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader) (at C:/Projects/sirenix-development-framework/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1610) Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean, List`1) (at C:/Projects/sirenix-development-framework/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1427) Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext) (at C:/Projects/sirenix-development-framework/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1147) Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:/Projects/sirenix-development-framework/OdinSerializer/OdinSerializer/Unity Integration/SerializedUnityObjects/SerializedMonoBehaviour.cs:37)

Comments (15)

  1. Tor Esa Vestergaard

    Hmm. This seems to happen sometimes - Unity just corrupting and wiping the data we have stored. This is the first time I've seen anything usable be left in the node list, though, after this happens. I'm not sure what we can do to prevent it, really - though in this case, it seems like we should perhaps try skipping all invalid entries so we can at least arrive at that valid bit of data and deserialize that. I'll need to think about it a bit. If you figure out a way to reproduce this issue reliably, that would be lovely - we've never figured out a set of reproduction steps that actually makes this happen consistently or even sporadically.

  2. Mark A reporter

    While it's not 100% repo on our project, it's not totally rare either. Unfortunately our project is large and I'm not sure that I can boil down a potential test case easily. I will do some investigation and report back what I find. When this does happen, what are the potential issues? lost data?

  3. Tor Esa Vestergaard

    I'm not actually certain whether there's any lost data - people have only ever reported the error, not any negative consequences they've encountered from it. It could be that Unity isn't wiping data, but just filling in garbage instead. It could go both ways.

  4. Tor Esa Vestergaard

    Issue #529 is essentially the same as this, and I've redirected the discussion from there to here, to keep things manageable. No reproduction steps have as yet been determined. Vinnie, have you identified which asset is causing the exception? It is very likely that causing the asset to re-serialize (IE, modifying it and then causing it to be saved to disk) will fix the issue. If that's not the case, then we have an actual reproduction case, since this corruption reoccurs consistently.

  5. Vinnie Vivace

    cool, thanks. No, I cannot provide any more information at this stage other than the fact this issue did not occur until we upgraded to 2019.1

  6. Vinnie Vivace

    now its a show stopper. As per comments on other issue, doing a Build will produce the errors but still result in a successful build. doing a build and run will fail, every time.

  7. Tor Esa Vestergaard

    Vinnie, I have a build that I'd like to send you that contains a few modifications in the error handling and the logging message. I'd like you to try your Build and Run during this, and see, first, if it works, and second, if the improved log messages help you handle the issue better. Can you give me your email or contact me on Discord through our Discord support channel so I can send the build to you?

  8. Tor Esa Vestergaard

    Mark, I can also send this build to you, if you would like to give it a go and see if this is more helpful. It logs a lot more data and helps you track down the precise asset in which the error took place.

  9. Mark A reporter

    Yes, I'd be happy to take a build from you to try this out. Currently the rest of my team is still using an older version of Odin because we ran into other problems with previous integrations that were causing player crashes. I wasn't at a spot to look at them more closely at the time so this time am taking a more cautious approach (we heavily use nested prefabs and I suspect that was part of the problem. 2.0.17 seems far better so far). Let me know how to grab and I can take a look and get you more data. We still do see this issue regularly but not terribly often

  10. Tor Esa Vestergaard

    You can send me a mail at tor@sirenix.net or hit me up on Discord and I'll send you the build.

  11. Mark A reporter

    As an update, I moved to 2.0.19 today and got this message again. The bad thing is that something happened during the Odin upgrade and the library had to be reimported which for us is about a 4 hour process. Reimport crashed and then I got this message after that. I did look around the log for a potential offending asset that was leading to this problem, but with all of the other things that were happening, my logs were large (and by the way, the reimport time and and crashes on reimport are things that we routinely see šŸ˜ž so Iā€™m not saying they were a result of upgrading Odin).

    I guess the good news is that I was able to make it happen again. I hope though that I can narrow down where I am seeing this.

  12. Mark A reporter

    I was able to get this problem again when just opening up the project this morning after the weekend. I actually have 10 instances of this opening up the project. The 10 instances are all on the same Component and of the 10, 1/2 show the READ POSITION at one point and 1/2 show it at another point. I will paste both of the relevant portions of the log below. I did search for DELAYED SERIALIZATION LOG, but only found the instances of that text in the warning text that says to search for it. I suspect though, that this might be because of an error in the subsequent log message. There seems to be a NULL name/member. The paste of the log information here has two errors in a row (one each with the two different read positions,) and then the NULL error from Odin that immediately follows. The lines before and after are just asset database updates for other assets. I assume that these are irrelevant based on the message from Odin, but let me know what else you need.

    ā€Œ

    Encountered invalid entry while reading serialization data for Unity object of type 'HealthComponent'. This likely means that Unity has filled Odin's stored serialization data with garbage, which can randomly happen after upgrading the Unity version of the project, or when otherwise doing things that have a lot of fragile interactions with the asset database. Locating the asset which causes this error log and causing it to reserialize (IE, modifying it and then causing it to be saved to disk) is likely to 'fix' the issue and make this message go away. Even so, DATA MAY HAVE BEEN LOST, and you should verify with your version control system (you're using one, right?!) that everything is alright, and if not, use it to rollback the asset to recover your data.

    A delayed warning message containing the originating object's name, type and scene/asset path (if applicable) will be scheduled for logging on Unity's main thread. Search for "DELAYED SERIALIZATION LOG". This logging callback will also mark the object dirty if it is an asset, hopefully making the issue 'fix' itself. HOWEVER, THERE MAY STILL BE DATA LOSS.

    IF YOU HAVE CONSISTENT REPRODUCTION STEPS THAT MAKE THIS ISSUE REOCCUR, please report it at this issue at 'https://bitbucket.org/sirenix/odin-inspector/issues/526', and copy paste this debug message into your comment, along with any potential actions or recent changes in the project that might have happened to cause this message to occur. If the data dump in this message is cut off, please find the editor's log file (see https://docs.unity3d.com/Manual/LogFiles.html)) and copy paste the full version of this message from there.

    Data dump:

    Reader type: SerializationNodeDataReader
    Data dump: Nodes: 
    
    - Name:     <<<< READ POSITION
      Entry: 0
      Data: 
    - Name: 
      Entry: 0
      Data: 
    - Name: 
      Entry: 6
      Data: 
    - Name: frozenDamageReactions
      Entry: 6
      Data: 
    

    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    Sirenix.Serialization.CustomLogger:LogError(String) (at C:\Projects\sirenix-development-framework\Sirenix Solution\Sirenix.Serialization.Config\CustomLogger.cs:59)
    Sirenix.Serialization.DebugContext:LogError(String) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Core\Serializers\Serializer.cs:84)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:152)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean, List`1) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:101)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:83)
    Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Unity Integration\SerializedUnityObjects\SerializedMonoBehaviour.cs:37)

    (Filename: C:/Projects/sirenix-development-framework/Sirenix Solution/Sirenix.Serialization.Config/CustomLogger.cs Line: 59)

    Encountered invalid entry while reading serialization data for Unity object of type 'HealthComponent'. This likely means that Unity has filled Odin's stored serialization data with garbage, which can randomly happen after upgrading the Unity version of the project, or when otherwise doing things that have a lot of fragile interactions with the asset database. Locating the asset which causes this error log and causing it to reserialize (IE, modifying it and then causing it to be saved to disk) is likely to 'fix' the issue and make this message go away. Even so, DATA MAY HAVE BEEN LOST, and you should verify with your version control system (you're using one, right?!) that everything is alright, and if not, use it to rollback the asset to recover your data.

    A delayed warning message containing the originating object's name, type and scene/asset path (if applicable) will be scheduled for logging on Unity's main thread. Search for "DELAYED SERIALIZATION LOG". This logging callback will also mark the object dirty if it is an asset, hopefully making the issue 'fix' itself. HOWEVER, THERE MAY STILL BE DATA LOSS.

    IF YOU HAVE CONSISTENT REPRODUCTION STEPS THAT MAKE THIS ISSUE REOCCUR, please report it at this issue at 'https://bitbucket.org/sirenix/odin-inspector/issues/526', and copy paste this debug message into your comment, along with any potential actions or recent changes in the project that might have happened to cause this message to occur. If the data dump in this message is cut off, please find the editor's log file (see https://docs.unity3d.com/Manual/LogFiles.html)) and copy paste the full version of this message from there.

    Data dump:

    Reader type: SerializationNodeDataReader
    Data dump: Nodes: 
    
    - Name: 
      Entry: 0
      Data: 
    - Name:     <<<< READ POSITION
      Entry: 0
      Data: 
    - Name: 
      Entry: 6
      Data: 
    - Name: frozenDamageReactions
      Entry: 6
      Data: 
    

    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    Sirenix.Serialization.CustomLogger:LogError(String) (at C:\Projects\sirenix-development-framework\Sirenix Solution\Sirenix.Serialization.Config\CustomLogger.cs:59)
    Sirenix.Serialization.DebugContext:LogError(String) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Core\Serializers\Serializer.cs:84)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:152)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean, List`1) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:101)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:83)
    Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Unity Integration\SerializedUnityObjects\SerializedMonoBehaviour.cs:37)

    (Filename: C:/Projects/sirenix-development-framework/Sirenix Solution/Sirenix.Serialization.Config/CustomLogger.cs Line: 59)

    Entry of type "Null" in node "" is missing a name.
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    Sirenix.Serialization.CustomLogger:LogError(String) (at C:\Projects\sirenix-development-framework\Sirenix Solution\Sirenix.Serialization.Config\CustomLogger.cs:59)
    Sirenix.Serialization.DebugContext:LogError(String) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Core\Serializers\Serializer.cs:84)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:152)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean, List`1) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:101)
    Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext) (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Utilities\Misc\DoubleLookupDictionary.cs:83)
    Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:\Projects\sirenix-development-framework\OdinSerializer\OdinSerializer\Unity Integration\SerializedUnityObjects\SerializedMonoBehaviour.cs:37)

    (Filename: C:/Projects/sirenix-development-framework/Sirenix Solution/Sirenix.Serialization.Config/CustomLogger.cs Line: 59)

  13. Log in to comment