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

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

我正在使用https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-stream-analytics将 ASA 作业部署到我的模拟 IoT 设备。我之前成功地将 IoT Edge 模块 (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

当我尝试获取边缘流分析作业日志时,我陷入了 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

更新3 这是 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.

[更新4] 流分析预览版 13 现已推出。 新日志 https://drive.google.com/open?id=1y3ioEoQaHfPxaek04HZtxRpmU1A4hoHf

最佳答案

根据您提供的模块日志和 Edgehub 日志,ASA 模块陷入获取作业定义的设备孪生属性的困境。 Edgehub 也遇到了几个类似的异常。模块似乎在连接到模块孪生时出现问题。您能否检查一下您的端口 443、5671 和 8883 是否可以接受传出流量?

关于azure - IoT 边缘上的流分析作业无法正常工作,异常 : System. AggregateException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53011328/

相关文章:

docker - 编译 azure iot edge 的 edgelet 模块时出现 cargo 错误

Azure SDK 2.9无效架构 "2015-04.2.6"

angular - 从前端访问azure databricks Rest api时出现CORS错误

azure - 通过 Visual Studio 在 Azure Functions 中使用 ServiceBus

azure - 未找到事件 - Azure 事件中心

Azure物联网边缘模块: Error while Build and Push IoT Edge Solution

python-3.6 - 返回协程对象的 Python 异步函数

azure - 无法对不同租户的 Azure api 进行身份验证

c# - 如何在 Eventhub 上以 CSV 形式发送数据以进行 Azure 流分析?

azure - 流分析: How can I start and stop a TUMBLINGWINDOW aggregation job inorder to reduce costs while still getting the same aggregation results?