Azure / device-simulation-dotnet

IoT Simulation service
MIT License
103 stars 73 forks source link

Simulation Service Stops on System.AggregateException #50

Closed jillcary closed 7 years ago

jillcary commented 7 years ago

Type of issue

Description

The Simulation service stops in a PCS remote monitoring solution when a System.AggregateException is thrown.

Steps to reproduce

  1. I deployed a new PCS remote monitoring solution
  2. solution ran overnight
  3. came back in the morning and the service crashed due to an exception thrown

Expected behavior

Service handles exception and keeps running

Current behavior

Service stops

Known workarounds

SSH into VM and restart the docker container

Possible solution

handle exception at the service layer

Logs

[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:05Z][DEBUG][SendTelemetry:Run] SendTelemetry..., {"deviceId":"Simulated.prototype-01.0","MessageSchema":"prototype-geolocation;v1","msg":"{\"latitude\":47.612514,\"longitude\":-122.204184}"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.truck-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.truck-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][ERROR][HttpClient:SendAsync] Request failed, {"Message":"A task was canceled. The request timed out, the endpoint might be unreachable.","e":{"ExceptionFullName":"System.Threading.Tasks.TaskCanceledException","ExceptionMessage":"A task was canceled.","StackTrace":"   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()\n   at System.Net.Http.StreamToStreamCopy.<CopyAsyncAnyStreamToAnyStreamCore>d__3.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\n   at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__48.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\n   at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Http.HttpClient.<SendAsync>d__9.MoveNext() in E:\\Repos\\device-simulation-dotnet\\Services\\Http\\HttpClient.cs:line 91","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][ERROR][Simulation:RunAsync] Unable to load simulation, {"e":{"ExceptionFullName":"Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Exceptions.ExternalDependencyException","ExceptionMessage":"An unexpected error happened while using an external dependency.","StackTrace":"   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.StorageAdapterClient.ThrowIfError(IHttpResponse response, String collectionId, String key) in E:\\Repos\\device-simulation-dotnet\\Services\\StorageAdapter\\StorageAdapterClient.cs:line 165\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.StorageAdapterClient.<GetAllAsync>d__7.MoveNext() in E:\\Repos\\device-simulation-dotnet\\Services\\StorageAdapter\\StorageAdapterClient.cs:line 85\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Simulations.<GetListAsync>d__7.MoveNext() in E:\\Repos\\device-simulation-dotnet\\Services\\Simulations.cs:line 46\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.SimulationAgent.Simulation.Simulation.<RunAsync>d__5.MoveNext() in E:\\Repos\\device-simulation-dotnet\\SimulationAgent\\Simulation\\Simulation.cs:line 46","Source":"Microsoft.Azure.IoTSolutions.DeviceSimulation.Services","Data":{},"InnerException":{"ExceptionFullName":"System.Net.Http.HttpRequestException","ExceptionMessage":"Storage request error: status code 0","StackTrace":null,"Source":null,"Data":{},"InnerException":null}}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][INFO][SimulationRunner:Stop] Stopping simulation...
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.truck-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:06Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.chiller-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.engine-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.chiller-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.truck-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.prototype-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:Stop] Stopped, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.truck-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.truck-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.chiller-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:07Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.elevator-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.elevator-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:08Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.elevator-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.chiller-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}

[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.elevator-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceActor:StopTimers] Stopping timers, {"deviceId":"Simulated.elevator-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][INFO][Timer:Stop] The timer was already disposed., {"e":{"ExceptionFullName":"System.ObjectDisposedException","ExceptionMessage":"Cannot access a disposed object.","StackTrace":"   at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)\n   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.Concurrency.Timer.Stop() in E:\\Repos\\device-simulation-dotnet\\Services\\Concurrency\\Timer.cs:line 69","Source":"System.Private.CoreLib","Data":{},"InnerException":null}}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceActor:Stop] Stopped, {"deviceId":"Simulated.elevator-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.chiller-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.chiller-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.chiller-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.chiller-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.elevator-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.elevator-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.prototype-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.prototype-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendRawMessageAsync] SendRawMessageAsync for device, {"deviceId":"Simulated.chiller-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][DeviceClient:SendMessageAsync] SendMessageAsync for device, {"deviceId":"Simulated.chiller-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.engine-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.truck-01.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.engine-02.0"}
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:09Z][DEBUG][HttpClient:SendAsync] Sending request, {"httpMethod":{"Method":"GET"},"Uri":"http://storageadapter:9022/v1/collections/simulations/values","Options":{"EnsureSuccess":false,"AllowInsecureSSLServer":false,"Timeout":10000}}
Unhandled Exception: System.AggregateException: One or more errors occurred. () ---> Microsoft.Azure.Devices.Client.Exceptions.IotHubClientException ---> System.AggregateException: One or more errors occurred. (connection timed out: 40.83.177.42:8883) ---> DotNetty.Transport.Channels.ConnectTimeoutException: connection timed out: 40.83.177.42:8883
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.<OpenAsync>d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.<OpenAsync>d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.<TryOpenPrioritizedTransportsAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.<TryOpenPrioritizedTransportsAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.<OpenAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass19_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<ExecuteWithErrorHandlingAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<ExecuteWithErrorHandlingAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<OpenAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<ExecuteWithErrorHandlingAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<RecoverConnections>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.GateKeeperDelegatingHandler.<RecoverConnections>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.TaskHelpers.<WithTimeout>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.DeviceClient.<OnConnectionClosed>d__65.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.<CloseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Devices.Client.Transport.GateKeeperDelegatingHandler.<CloseAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.IoTSolutions.DeviceSimulation.Services.DeviceClient.<DisconnectAsync>d__16.MoveNext() in E:\Repos\device-simulation-dotnet\Services\DeviceClient.cs:line 140
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
   at Microsoft.Azure.IoTSolutions.DeviceSimulation.SimulationAgent.Simulation.DeviceActor.Stop() in E:\Repos\device-simulation-dotnet\SimulationAgent\Simulation\DeviceActor.cs:line 265
   at Microsoft.Azure.IoTSolutions.DeviceSimulation.SimulationAgent.Simulation.DeviceStatusLogic.SendTelemetry.Run(Object context) in E:\Repos\device-simulation-dotnet\SimulationAgent\Simulation\DeviceStatusLogic\SendTelemetry.cs:line 82
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
[SimulationAgent.893ad5cb-e720-4f48-a63e-646977730982][2017-09-08 01:10:10Z][DEBUG][SendTelemetry:Run] SendTelemetry complete, {"deviceId":"Simulated.prototype-01.0"}
/app/run.sh: line 7:     6 Aborted                 (core dumped) dotnet Microsoft.Azure.IoTSolutions.DeviceSimulation.SimulationAgent.dll
jillcary commented 7 years ago

https://github.com/Azure/telemetry-agent-dotnet/pull/22/files

timlaverty commented 7 years ago

this is tied to simulation, not the telemetry-agent

dluc commented 7 years ago

I think this can be closed after https://github.com/Azure/device-simulation-dotnet/commit/51630ec0ccc4da75139d552ae91a99887b293433 We're still looking into reliability as part of other tasks