Closed bbrandt closed 8 years ago
Here's the content of the stream coming back from Seq:
"[{\"Title\":\"Test Timeout\",\"IsManualInputOnly\":true,\"AppId\":\"hostedapp-2\",\"Settings\":{\"Timeout\":\"360\",\"Repeat\":\"False\",\"Name\":\"Test\"},\"ArrivalWindow\":\"00:00:30\",\"SignalIds\":[],\"Id\":\"appinstance-10\",\"Links\":{\"Self\":\"api/appinstances/appinstance-10\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-10/invoke{?eventId}\"}},{\"Title\":\"Test Threshold\",\"IsManualInputOnly\":true,\"AppId\":\"hostedapp-6\",\"Settings\":{\"WindowSeconds\":\"60\",\"EventsInWindowThreshold\":\"5\",\"SuppressionSeconds\":\"360\",\"ThresholdName\":\"Threshold Test\"},\"ArrivalWindow\":\"00:00:30\",\"SignalIds\":[],\"Id\":\"appinstance-12\",\"Links\":{\"Self\":\"api/appinstances/appinstance-12\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-12/invoke{?eventId}\"}},{\"Title\":\"Error Archive\",\"IsManualInputOnly\":false,\"AppId\":\"hostedapp-4\",\"Settings\":{\"PathFormat\":\"F:\\\\src\\\\logs\\\\error-{Date}.log\"},\"ArrivalWindow\":null,\"SignalIds\":[\"signal-65\"],\"Id\":\"appinstance-16\",\"Links\":{\"Self\":\"api/appinstances/appinstance-16\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-16/invoke{?eventId}\"}},{\"Title\":\"Warning Archive\",\"IsManualInputOnly\":false,\"AppId\":\"hostedapp-4\",\"Settings\":{\"PathFormat\":\"F:\\\\src\\\\logs\\\\warning-{Date}.log\"},\"ArrivalWindow\":null,\"SignalIds\":[\"signal-194\"],\"Id\":\"appinstance-196\",\"Links\":{\"Self\":\"api/appinstances/appinstance-196\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-196/invoke{?eventId}\"}},{\"Title\":\"Below Warning\",\"IsManualInputOnly\":false,\"AppId\":\"hostedapp-4\",\"Settings\":{\"PathFormat\":\"F:\\\\src\\\\logs\\\\below-warning-{Date}.log\"},\"ArrivalWindow\":null,\"SignalIds\":[\"signal-193\"],\"Id\":\"appinstance-198\",\"Links\":{\"Self\":\"api/appinstances/appinstance-198\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-198/invoke{?eventId}\"}},{\"Title\":\"New Errors\",\"IsManualInputOnly\":false,\"AppId\":\"hostedapp-199\",\"Settings\":{},\"ArrivalWindow\":null,\"SignalIds\":[\"signal-65\"],\"Id\":\"appinstance-201\",\"Links\":{\"Self\":\"api/appinstances/appinstance-201\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-201/invoke{?eventId}\"}},{\"Title\":\"Test Email\",\"IsManualInputOnly\":true,\"AppId\":\"hostedapp-3\",\"Settings\":{\"From\":\"ben.brandt@flowcal.com\",\"To\":\"ben.brandt@flowcal.com\",\"SubjectTemplate\":\"\",\"Host\":\"smtp.office365.com\",\"Port\":\"587\",\"EnableSsl\":\"True\",\"BodyTemplate\":\"\",\"Username\":\"ben.brandt@flowcal.com\",\"Password\":\"[seq-preserve]\"},\"ArrivalWindow\":\"00:00:30\",\"SignalIds\":[],\"Id\":\"appinstance-8\",\"Links\":{\"Self\":\"api/appinstances/appinstance-8\",\"Group\":\"api/appinstances/resources\",\"Invoke\":\"api/appinstances/appinstance-8/invoke{?eventId}\"}}]"
Beautified:
[
{
"Title":"Test Timeout",
"IsManualInputOnly":true,
"AppId":"hostedapp-2",
"Settings":{
"Timeout":"360",
"Repeat":"False",
"Name":"Test"
},
"ArrivalWindow":"00:00:30",
"SignalIds":[
],
"Id":"appinstance-10",
"Links":{
"Self":"api/appinstances/appinstance-10",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-10/invoke{?eventId}"
}
},
{
"Title":"Test Threshold",
"IsManualInputOnly":true,
"AppId":"hostedapp-6",
"Settings":{
"WindowSeconds":"60",
"EventsInWindowThreshold":"5",
"SuppressionSeconds":"360",
"ThresholdName":"Threshold Test"
},
"ArrivalWindow":"00:00:30",
"SignalIds":[
],
"Id":"appinstance-12",
"Links":{
"Self":"api/appinstances/appinstance-12",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-12/invoke{?eventId}"
}
},
{
"Title":"Error Archive",
"IsManualInputOnly":false,
"AppId":"hostedapp-4",
"Settings":{
"PathFormat":"F:\\\\src\\\\logs\\\\error-{Date}.log"
},
"ArrivalWindow":null,
"SignalIds":[
"signal-65"
],
"Id":"appinstance-16",
"Links":{
"Self":"api/appinstances/appinstance-16",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-16/invoke{?eventId}"
}
},
{
"Title":"Warning Archive",
"IsManualInputOnly":false,
"AppId":"hostedapp-4",
"Settings":{
"PathFormat":"F:\\\\src\\\\logs\\\\warning-{Date}.log"
},
"ArrivalWindow":null,
"SignalIds":[
"signal-194"
],
"Id":"appinstance-196",
"Links":{
"Self":"api/appinstances/appinstance-196",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-196/invoke{?eventId}"
}
},
{
"Title":"Below Warning",
"IsManualInputOnly":false,
"AppId":"hostedapp-4",
"Settings":{
"PathFormat":"F:\\\\src\\\\logs\\\\below-warning-{Date}.log"
},
"ArrivalWindow":null,
"SignalIds":[
"signal-193"
],
"Id":"appinstance-198",
"Links":{
"Self":"api/appinstances/appinstance-198",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-198/invoke{?eventId}"
}
},
{
"Title":"New Errors",
"IsManualInputOnly":false,
"AppId":"hostedapp-199",
"Settings":{
},
"ArrivalWindow":null,
"SignalIds":[
"signal-65"
],
"Id":"appinstance-201",
"Links":{
"Self":"api/appinstances/appinstance-201",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-201/invoke{?eventId}"
}
},
{
"Title":"Test Email",
"IsManualInputOnly":true,
"AppId":"hostedapp-3",
"Settings":{
"From":"ben.brandt@flowcal.com",
"To":"ben.brandt@flowcal.com",
"SubjectTemplate":"",
"Host":"smtp.office365.com",
"Port":"587",
"EnableSsl":"True",
"BodyTemplate":"",
"Username":"ben.brandt@flowcal.com",
"Password":"[seq-preserve]"
},
"ArrivalWindow":"00:00:30",
"SignalIds":[
],
"Id":"appinstance-8",
"Links":{
"Self":"api/appinstances/appinstance-8",
"Group":"api/appinstances/resources",
"Invoke":"api/appinstances/appinstance-8/invoke{?eventId}"
}
}
]
Not sure if the exception I was observing is expected or not by Seq.Api, so here's the actual failure being reported in my implementation test:
ImplementationTestSetUp : System.AggregateException : One or more errors occurred.
----> Newtonsoft.Json.JsonSerializationException : Error converting value {null} to type 'System.TimeSpan'. Path '[2].ArrivalWindow', line 1, position 908.
----> System.ArgumentException : Could not cast or convert from {null} to System.TimeSpan.
TearDown : System.AggregateException : One or more errors occurred.
----> Newtonsoft.Json.JsonSerializationException : Error converting value {null} to type 'System.TimeSpan'. Path '[2].ArrivalWindow', line 1, position 908.
----> System.ArgumentException : Could not cast or convert from {null} to System.TimeSpan.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at FlowCal.LogsModule.Tests.DataRepository.SeqNotificationRepositoryImplementationTests.SetUp() in SeqNotificationRepositoryImplementationTests.cs: line 119
--JsonSerializationException
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.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.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at Seq.Api.Client.SeqApiClient.<HttpGetAsync>d__1f`1.MoveNext() in SeqApiClient.cs: line 112
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Seq.Api.ResourceGroups.ApiResourceGroup.<GroupListAsync>d__5`1.MoveNext() in ApiResourceGroup.cs: line 37
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Seq.Api.ResourceGroups.AppInstancesResourceGroup.<ListAsync>d__4.MoveNext() in AppInstancesResourceGroup.cs: line 23
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at FlowCal.LogsModule.Tests.DataRepository.SeqNotificationRepositoryImplementationTests.<ClearAllAmpAppInstances>d__18.MoveNext() in SeqNotificationRepositoryImplementationTests.cs: line 136
--ArgumentException
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--TearDown
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at FlowCal.LogsModule.Tests.DataRepository.SeqNotificationRepositoryImplementationTests.TearDown() in SeqNotificationRepositoryImplementationTests.cs: line 126
--JsonSerializationException
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.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.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at Seq.Api.Client.SeqApiClient.<HttpGetAsync>d__1f`1.MoveNext() in SeqApiClient.cs: line 112
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Seq.Api.ResourceGroups.ApiResourceGroup.<GroupListAsync>d__5`1.MoveNext() in ApiResourceGroup.cs: line 37
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Seq.Api.ResourceGroups.AppInstancesResourceGroup.<ListAsync>d__4.MoveNext() in AppInstancesResourceGroup.cs: line 23
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at FlowCal.LogsModule.Tests.DataRepository.SeqNotificationRepositoryImplementationTests.<ClearAllAmpAppInstances>d__18.MoveNext() in SeqNotificationRepositoryImplementationTests.cs: line 136
--ArgumentException
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
Thanks for the report Ben, I'll have a look.
Thanks for the quick resolution. This morning I was able to reproduce the issue with the old version, update Seq.Api to 2.1.32, and confirm that the issue has been resolved.
I am getting an exception running this code:
I am able to produce the exception in my VS2013 debugger and have stepped into the Seq.Api assembly method HttpGetAsync<>(string), but am not really sure how to proceed from here.
The Exception:
Debugger callstack: