1

I'm using https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-stream-analytics to deploy an ASA job to my simulated IoT device. I previously successfully deployed an IoT Edge Module (tempSensor) to the edge device and it works perfectly. I can read the temperature in the logs.

I create an edge Stream Analytics module, specified a container and deployed it on my IoT edge device (here: my windows PC). Every module had the status as 'running' and the checkboxes were checked under 'deployment' and 'reported by device' columns. So far so good. So if I used the command iotedge list I get the list of all the running modules.

enter image description here

However, if I ran the following command in Powershell docker logs IoTEdgeJob to see if the query inside the ASA job ran. I get an exception:

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 ...

After sometime I got this error in my edgeHub.

enter image description here

I have done exactly as said in the documentation. Any ideas why am I getting this error?

UPDATE Please find logs at this link: https://drive.google.com/open?id=1ubUEjP17mYIvYI0aGGZHGU0JiCLUFhCS

UPDATE 2 Please find updated logs at this link: https://drive.google.com/open?id=1YNIX8XZTSRFjgnyWUkhOLFELK6bmVFa_

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

When I try to get Edge Stream Analytics Job logs, I get stuck at ASA getting path:

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 Here are the logs for IoTEdgeJob(Stream Analytics) https://drive.google.com/open?id=1x0tb-6tu5X1dr8K_QEETiRwV6Git60PQ

Also these are part of the logs for 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] Stream analytics preview 13 now available. New Logs https://drive.google.com/open?id=1y3ioEoQaHfPxaek04HZtxRpmU1A4hoHf

MAK
  • 1,250
  • 21
  • 50
  • The exception you got was due to client initialization timeout, which might due to network issue. Could you please also provide the logs from edgeHub as well? Thank you! – Julia Oct 26 '18 at 23:49
  • @Julia. I have added the logs. – MAK Oct 29 '18 at 13:01

1 Answers1

0

From the module logs and edgehub logs you provided, ASA module stuck in getting device twin property for job definition. edgehub also got several similar exceptions. it seems modules had problem with connecting to module twin. Could you please check if your port 443, 5671 and 8883 could take outgoing traffic?

Julia
  • 51
  • 1
  • I tried with our network team and they tried to resolve this issue. I was still not able to get the stream module running on IoT edge. I've provided the link for the latest logs in the question. – MAK Nov 05 '18 at 19:17
  • From your latest log, the twin connection issue seems resolved, cause module have get job SASUrl. could you please share the version of asa image (image name) you are running? It stuck in fetching job from blob. – Julia Nov 07 '18 at 20:12
  • microsoft/azureiotedge-azure-stream-analytics:1.0.0-preview012 – MAK Nov 08 '18 at 15:05
  • I've added the logs from Stream Analytics Job and EdgeHub – MAK Nov 08 '18 at 15:17
  • From log, iotedgejob has problem with downloading job from blob, I tried to ping the SASUrl from the log you attached and got ContainerNotFound exception. Could you please double check that the container you published your job is still valid? Thanks! – Julia Nov 12 '18 at 19:14
  • I deleted that container. Re did the whole thing. But I'm getting the error again. Preview 013 is available for IoTEdgeJob too. – MAK Nov 12 '18 at 19:31
  • There are a few cases might cause problem with reaching azure storage blob from your device. You would like to check whether you have the proper certificate authorities installed on the machine. If that doesn't solve your problem, try to check if the server resolve the ip address properly for the storage account, if it is not 52.179.144.64(checked from my server), you could add a mapping to the host file. – Julia Nov 14 '18 at 03:13