代码之家  ›  专栏  ›  技术社区  ›  MAK

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

  •  1
  • MAK  · 技术社区  · 7 年前

    我在用 https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-stream-analytics 将ASA作业部署到我的模拟物联网设备。我之前成功地在边缘设备上部署了一个IoT边缘模块(tempSensor),它工作得非常完美。我能从日志中读出温度。

    我创建了一个边缘流分析模块,指定了一个容器并将其部署到我的物联网边缘设备(这里是我的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

    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

    1 回复  |  直到 7 年前
        1
  •  0
  •   Julia    7 年前

    从您提供的模块日志和edgehub日志来看,ASA模块在获取用于作业定义的设备孪生属性时卡住了。edgehub也有几个类似的例外。似乎模块与孪生模块的连接有问题。请检查一下您的443、5671和8883端口是否可以接收传出的流量?