LogError Issue With Unity2017.1

Issue #126 resolved
Shane Padgett
created an issue

I am getting the following error each time I enter and exit playmode. Based on the stack, I have no way of determining if this issue is with something in my code, or just something throwing an error with Odin.

Entry of type "Invalid" in node "" is missing a name.
UnityEngine.Debug:LogError(Object)
Sirenix.Serialization.CustomLogger:LogError(String) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization.Config/CustomLogger.cs:53)
Sirenix.Serialization.DebugContext:LogError(String) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Misc/SerializationConfig.cs:193)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, IDataReader) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:1041)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:894)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext, Boolean) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:863)
Sirenix.Serialization.UnitySerializationUtility:DeserializeUnityObject(Object, SerializationData&, DeserializationContext) (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Utilities/UnitySerializationUtility.cs:734)
Sirenix.OdinInspector.SerializedMonoBehaviour:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.Serialization/Unity Integration/SerializedMonoBehaviour.cs:26)

Using:
Unity 2017.1.0f1 - I also have unit set to use .Net 4.6 if that could be part of the problem.
Odin 1.0.3.0
Windows 10

Comments (13)

  1. Tor Esa Vestergaard
    • changed status to open

    Thanks for the report!

    This seems to be an issue with some data that Odin is trying to deserialize. This may be a one-time issue with data having been corrupted by a bad merge, or it may be a more systemic issue with serialization in general when given a particular set of values to serialize.

    It would be very helpful if you could narrow down which object in the scene is causing the error to show up. Just deleting objects until it stops should do it. Then, giving the Odin serialized member declarations of the component in question, and sending the scene file with the faulty object in it, would make the issue far easier to diagnose.

    Also, out of curiosity, does the issue go away if you change something in the scene, and then save it again?

  2. Shane Padgett reporter

    I may have actually found it. I use a package called InControl. InControl has a manager component that has to be in the scene. I was systemically removing component by component trying to figure out where this came from, but as soon as I removed the InControl Manager component it went away. I also added the manager component back to the scene and I now no longer get this error.

  3. Tor Esa Vestergaard

    It would be very odd if that was the case, as this stacktrace occurs in code that only runs on components derived from SerializedMonoBehaviour, which have Odin-serialized values in them. Are you quite sure that was the component in question - or were there perhaps other Odin-serialized components on the same GameObject?

  4. Shane Padgett reporter

    I am positive it was that component. I wasn't deleting gameobjects, I was individually removing components. When I removed that specific manager component it stopped. I will try again as I am able to reproduce the issue from version control. Will let you know again if it was that component for sure.

  5. Tor Esa Vestergaard

    Alright, thanks. That sort of stuff having fixed it, does make it seem quite plausible that it was a one-off thing, bad data somehow having gotten into one of the objects in the scene, due to a merge conflict or whatever else. If you do find a way to reliably cause it to happen though, we're definitely all ears.

  6. Shane Padgett reporter

    Ok, so through extensive testing, this did come out to be one of my own components. It was a component that was using serialized InControl data. In the affected scene, merely clicking revert on the prefab in question caused the error to stop reporting. Thank you for the help.

  7. Tor Esa Vestergaard

    Just for posterity's sake, so I can test if this is somehow replicable rather than being a one-off accident, could you perhaps post the structure of the serialized data in question (IE, the serialized members of the classes, etc?). If you'd rather not, I'll mark this down as resolved, for now, and make a note to provide more contextual information in our serialization system's error logging.

  8. Shane Padgett reporter

    Ok so here is the before and after. Some context first though. I was using Unity 5.6.2f1 when I first created my input script. I then upgraded to Unity2017.1f1 and also changed over to .Net 4.6. After I changed to the new Unity and .Net, I then updated the script to use the newly available syntax. As you can see, in the previous version of the script, I only had 1 field serialized. In the new version, I do not have anything serialized. So the issue seems to be with the fact that I removed the serialized field. Hope this helps. I replaced the "_holdButtonForSprint" field with an enum property.

    Previous Version Of Script's Members With Serialization

            private PlayerInputActions _inputActions;
    
            private Subject<Vector2> _onMove = new Subject<Vector2>();
    
            private Subject<Vector2> _onLook = new Subject<Vector2>();
    
            private Subject<bool> _onJumpPressed = new Subject<bool>();
    
            private Subject<bool[]> _onSprintPressed = new Subject<bool[]>();
    
            private Subject<bool> _onInteractPressed = new Subject<bool>();
    
            private Subject<bool> _onOpenOptionsMenuPressed = new Subject<bool>();
    
    
            [OdinSerialize]
            private bool _holdButtonForSprint;
    
            public bool HoldButtonForSprint
            {
                get { return _holdButtonForSprint; }
                set { _holdButtonForSprint = value; }
            }
    
    
            #region Observable Input Properties
    
            public IObservable<Vector2> OnMove { get { return _onMove; } }
    
            public IObservable<Vector2> OnLook { get { return _onLook; } }
    
            public IObservable<bool> OnJumpPressed { get { return _onJumpPressed; } }
    
            public IObservable<bool[]> OnSprintPressed { get { return _onSprintPressed; } }
    
            public IObservable<bool> OnInteractPressed { get { return _onInteractPressed; } }
    
            public IObservable<bool> OnOpenOptionsMenuPressed { get { return _onOpenOptionsMenuPressed; } }
    
            #endregion
    

    New Version Of Script's Members Without Serialization

            private PlayerInputActions _inputActions;
    
    
            public SprintInputStyle SprintInputStyle { get; set; }
    
    
            #region Opservable Input Properties
    
            public IReactiveProperty<Vector2> OnMove { get; } = new ReactiveProperty<Vector2>();
    
            public IReactiveProperty<Vector2> OnLook { get; } = new ReactiveProperty<Vector2>();
    
            public UnityEvent OnJumpPressed { get; } = new UnityEvent();
    
            public UnityEvent OnSprintPressed { get; } = new UnityEvent();
    
            public UnityEvent OnSprintReleased { get; } = new UnityEvent();
    
            public UnityEvent OnInteractPressed { get; } = new UnityEvent();
    
            public UnityEvent OnToggleOptionsMenuVisiblePressed { get; } = new UnityEvent();
    
            #endregion
    
  9. Tor Esa Vestergaard

    Thanks a lot for posting that - I'll play around with it a bit and see if I can provoke the issue. And yes, we're aware of that issue. This is currently a necessity, as the .dlls do work right now, and Odin is backwards compatible all the way back to Unity 5.3, and uses a few outdated APIs from there in its compiled assembly version. We can't currently include different assemblies for different versions of Unity in the .unitypackage (the asset store doesn't allow this - everybody gets the exact same .unitypackage, no exceptions), while maintaining the present ease of installing Odin, but once we finish that installer that we keep mentioning on the forums, we will be able to install version-specific .dll's in your project, and such messages will cease appearing (and it will also open Odin up to taking advantage of newer Unity features, for the people who use newer versions of Unity).

  10. Log in to comment