Closed megakid closed 3 years ago
Describe the bug Client library spits out JSON deserialization error when nodes are in DiscoverLeader state.
DiscoverLeader
To Reproduce Steps to reproduce the behavior:
Expected behavior No errors to occur
Actual behavior Client spits out errors - eventually reconnects successfully once cluster quorum is established.
Config/Logs/Screenshots
Failed to get cluster info from ["Unspecified/REDACTED"]: deserialization error: "Newtonsoft.Json.JsonSerializationException: Error converting value \"DiscoverLeader\" to type 'EventStore.ClientAPI.Messages.ClusterMessages+VNodeState'. Path 'members[0].state', line 6, position 31. ---> System.ArgumentException: Requested value 'DiscoverLeader' was not found. at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) --- End of inner exception stack trace --- at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at EventStore.ClientAPI.Internal.ClusterDnsEndPointDiscoverer.<>c__DisplayClass16_0.<TryGetGossipFrom>b__0(HttpResponse response)".
EventStore details
Additional context Add any other context about the problem here.
This is caused by:
https://github.com/EventStore/EventStoreDB-Client-Dotnet-Legacy/blob/661438208d2848e497f16aeb1203bcf198ac1d6a/src/EventStore.ClientAPI/Messages/ClusterMessages.cs#L74-L92
not containing DiscoverLeader enum value.
I assume this should match the EventStore.Core enum values here:
EventStore.Core
https://github.com/EventStore/EventStore/blob/3684a8ed66c968df2b090241b3be602a20c102a6/src/EventStore.Core/Data/VNodeState.cs#L3-L20
Describe the bug Client library spits out JSON deserialization error when nodes are in
DiscoverLeader
state.To Reproduce Steps to reproduce the behavior:
Expected behavior No errors to occur
Actual behavior Client spits out errors - eventually reconnects successfully once cluster quorum is established.
Config/Logs/Screenshots
EventStore details
Additional context Add any other context about the problem here.