IoT边缘上的流分析作业无法正常工作,异常:System.AggregateException

时间:2018-10-26 14:52:23

标签: azure azure-stream-analytics azure-iot-edge

我正在使用https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-stream-analytics将ASA作业部署到模拟的IoT设备。我以前曾成功地将IoT边缘模块(tempSensor)部署到边缘设备,并且运行良好。我可以在日志中读取温度。

我创建了一个边缘流分析模块,指定了一个容器并将其部署在我的IoT边缘设备(这里是我的Windows PC)上。每个模块的状态为“正在运行”,并且在“部署”和“按设备报告”列下选中了复选框。到目前为止,一切都很好。因此,如果我使用命令iotedge list,则会得到所有正在运行的模块的列表。

enter image description here

但是,如果我在Powershell docker logs IoTEdgeJob中运行了以下命令,以查看ASA作业中的查询是否运行了。我有一个例外:

10/26/2018 14:15:59 - Module client initializing ...
10/26/2018 14:17:07 - Opened module client connection

Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (Operation timeout expired.)) ---> System.AggregateException: One or more errors occurred. (Operation timeout expired.) ---> System.TimeoutException: Operation timeout expired.
   at Microsoft.Azure.Devices.Client.InternalClient.<>c.<ApplyTimeoutTwin>b__64_2(Task`1 t)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Streaming.Edge.Bindings.EdgeHubClientWrapper.GetJobDefinition() in M:\FXAGENT-001\_work\1\s\Product\Source\Edge\Bindings\Adapter\EdgeHubClientWrapper.cs:line 105
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at ASA.Container.Edge.Program.Init() in M:\FXAGENT-001\_work\1\s\Product\Source\DotNetCore\Container.App.Edge\Program.cs:line 48
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at ASA.Container.Edge.Program.Main(String[] args) in M:\FXAGENT-001\_work\1\s\Product\Source\DotNetCore\Container.App.Edge\Program.cs:line 34
10/26/2018 14:21:21 - Module client initializing ...
10/26/2018 14:21:22 - Opened module client connection
10/26/2018 14:25:31 - Module client initializing ...

一段时间后,我的edgeHub中出现此错误。

enter image description here

我完全按照文档中的说明进行操作。知道为什么我会收到此错误吗?

更新 请在此链接中找到日志: https://drive.google.com/open?id=1ubUEjP17mYIvYI0aGGZHGU0JiCLUFhCS

更新2 请在以下链接中找到更新的日志: https://drive.google.com/open?id=1YNIX8XZTSRFjgnyWUkhOLFELK6bmVFa_

https://drive.google.com/open?id=11u2Y9wfZaqpC0oK85oGZ2PG_SIGkfEOv

当我尝试获取Edge Stream Analytics作业日志时,我被困在ASA获取路径上:

11/05/2018 18:17:01 - Module client initializing ...
11/05/2018 18:17:03 - Opened module client connection
11/05/2018 18:17:03 - ASA getting path: https://phiotrawdatadev.blob.core.windows.net/asacontaineredge/ASAEdgeJobs/f1a5947d-293e-45b1-94f5-54398f96f6f1/24ba1e30-da99-4ab5-bce1-fad437e30826/ASAEdgeJobDefinition.zip?sv=2017-04-17&sr=b&sig=qHz7PUnogKQpJaTyezppHO2zXe5lrXmUX42PJjiPqac%3D&st=2018-11-05T18%3A06%3A27Z&se=2021-11-05T18%3A16%3A27Z&sp=r

UPDATE3 这是IoTEdgeJob(流分析)的日志 https://drive.google.com/open?id=1x0tb-6tu5X1dr8K_QEETiRwV6Git60PQ

这些也是EdgeHub日志的一部分

2018-11-08 15:11:43.848 +00:00 [INF] - Set subscriptions from session state for myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.913 +00:00 [INF] - Client myEdgeDevice/IoTEdgeJob in device scope authenticated locally.
2018-11-08 15:11:44.913 +00:00 [INF] - Successfully generated identity for clientId myEdgeDevice/IoTEdgeJob and username {username}/myEdgeDevice/IoTEdgeJob/?api-version=2018-06-30&DeviceClientType=Microsoft.Azure.Devices.Client%2F1.18.1%20%28.NET%20Core%204.6.26515.07%3B%20Linux%204.9.93-linuxkit-aufs%20%231%20SMP%20Wed%20Jun%206%2016%3A55%3A56%20UTC%202018%3B%20X64%29%20Microsoft.stream-analytics-on-iot-edge
2018-11-08 15:11:44.916 +00:00 [INF] - ClientAuthenticated, myEdgeDevice/IoTEdgeJob, 305bf5b5
2018-11-08 15:11:44.916 +00:00 [INF] - New device connection for device myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.917 +00:00 [WRN] - Closing connection for device: myEdgeDevice/IoTEdgeJob, Microsoft.Azure.Devices.Edge.Hub.Core.MultipleConnectionsException: Multiple connections detected for device myEdgeDevice/IoTEdgeJob,
2018-11-08 15:11:44.917 +00:00 [INF] - Disposing MessagingServiceClient for device Id myEdgeDevice/IoTEdgeJob because of exception - Microsoft.Azure.Devices.Edge.Hub.Core.MultipleConnectionsException: Multiple connections detected for device myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.917 +00:00 [INF] - Closing device proxy for device Id myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.917 +00:00 [INF] - Bind device proxy for device myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.917 +00:00 [INF] - Binding message channel for device Id myEdgeDevice/IoTEdgeJob
2018-11-08 15:11:44.926 +00:00 [INF] - Processing subscription TwinResponse for client myEdgeDevice/IoTEdgeJob.
2018-11-08 15:11:44.926 +00:00 [INF] - Processing subscription DesiredPropertyUpdates for client myEdgeDevice/IoTEdgeJob.

[UPDATE 4] 流分析预览13现在可用。 新日志 https://drive.google.com/open?id=1y3ioEoQaHfPxaek04HZtxRpmU1A4hoHf

1 个答案:

答案 0 :(得分:0)

从您提供的模块日志和edgehub日志中,ASA模块陷入了获取作业任务的设备孪生属性的困境。 edgehub也有一些类似的例外。看来模块在连接到模块Twin时有问题。您能否检查443、5671和8883端口是否可以接收传出流量?