question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error during module execution inside IoT Edge

See original GitHub issue

I tried to run the module inside IoT Edge without the EdgeHubConnectionString as argument, but I get the following exception:

[11:28:46 DBG] Starting Module Host...
[11:28:46 ERR] Error during module execution - restarting!
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.<>c__DisplayClass5_0.<CreateAsync>b__0(ConnectionStatus s, ConnectionStatusChangeReason r)
   at Microsoft.Azure.Devices.Client.InternalClient.OnConnectionStatusChanged(ConnectionStatus status, ConnectionStatusChangeReason reason)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.IIoT.Module.Framework.Hosting.ModuleHost.StartAsync(String type, String siteId, String serviceInfo, IProcessControl reset)
   at Microsoft.Azure.IIoT.Modules.OpcUa.Twin.ModuleProcess.RunAsync() in /src/src/ModuleProcess.cs:line 93
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.<>c__DisplayClass5_0.<CreateAsync>b__0(ConnectionStatus s, ConnectionStatusChangeReason r)
   at Microsoft.Azure.Devices.Client.InternalClient.OnConnectionStatusChanged(ConnectionStatus status, ConnectionStatusChangeReason reason)
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass35_0.<<OpenAsyncInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Devices.Client.InternalClient.OpenAsync()
   at Microsoft.Azure.IIoT.Module.Framework.Client.IoTSdkFactory.ModuleClientAdapter.CreateAsync(String product, IotHubConnectionStringBuilder cs, ITransportSettings transportSetting, TimeSpan timeout, IRetryPolicy retry, Action onConnectionLost, ILogger logger)
   at Microsoft.Azure.IIoT.Utils.Try.Options[T](Func`1[] options)<---

It’s running on Linux amd64 and the latest mschier_develop (master or tag 2.0.0 doesn’t compile: ‘LogEx’ does not contain a definition for ‘Level’). It’s running when I set cmd EdgeHubConnectionString (which is the module connection string, not edgehub)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marcschiercommented, Apr 3, 2019

The network mode issue lies in the createOptions which should be "createOptions": "{\"NetworkingConfig\": {\"EndpointsConfig\": {\"host\": {}}}, \"HostConfig\": {\"NetworkMode\": \"host\" }}"

0reactions
marcschiercommented, Sep 7, 2019

In 2.5.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Azure IoT Edge common errors
Resolve common issues encountered when using an IoT Edge solution. ... Option 2: Set DNS server in IoT Edge deployment per module.
Read more >
IoTEdge: error in module running, but manual restart works
Hello everyone, I am trying to deploy a solution on my iotedge device. The solution is the Custom vision system available on Microsoft...
Read more >
Azure IoT Edge Module : Error while Build and Push ...
Looks like one of the paths in your command cannot be found in the intermediate docker image. Try running a shell directly on...
Read more >
IoT Edge module fails to send a message to edgeHub with ...
The custom module was successfully sending messages to the edge hub till IoT Edge runtime version 1.2.10. This issue was noticed in a...
Read more >
Azure IoT Edge for Visual Studio Code
Build and publish IoT Edge modules; Debug IoT Edge modules locally and remotely; IntelliSense and code snippets for the deployment manifest ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found