Search code examples
azure-iot-hubazure-iot-edgeazure-iot-hub-device-management

Azure IoT Edge Module Twin Settings Set to Empty


I have a number of devices deployed with edge modules running on them. I created a deployment in Azure Portal that targets all devices which sets the environment variables and docker settings. The deployment does not set the twin settings.

I then went into the Azure portal, clicked on the individual devices, clicked "Set modules" and set specific twin module settings for each device.

The problem now is after a period of time some of the devices are receiving an transient network error to Azure Hub which causes them to reload the module twin configuration, however some of the devices load a totally empty twin config, It will continue to periodic auto refresh twin settings with the empty twin settings. If i restart the iotedge service it refreshes the twins and will pull down the correct twin config again and continue to run as expected for a period.

This is a major issue because the modules are basically hung until I log in and manually restart the iotedge service.

Is this the correct way to configure edge modules? or am I missing something?

Thanks


Solution

  • After reading the following post it appears we did not properly implement a handler for twin patches. I think the edge runtime calling the twin update hook with no properties after a connection interruption is a bug however we were able to write logic to handle it based on the examples provided in the post.

    https://github.com/Azure/iotedge/issues/1654#issuecomment-551258642