iotblackbelt / node-red-contrib-azure-iot-device

Azure IoT Device node for Node-Red
MIT License
21 stars 18 forks source link

No connection and node-red crashes when internet connection is down during and after deploy #5

Closed dkby closed 3 years ago

dkby commented 3 years ago

Setting: Using the node on Weidmueller u-controll web device (node red v1.1.2) . Provisioning with DPS (CA based x509).

Scenario for reproduction:

  1. Internet connection breaks (pull ethernet connection).
  2. Deploy application.
  3. Node changes to "disconnected" and later to "error"
  4. Internet connection is reestablished
  5. In case one tries to send a telemetry message, node-red crashes.

Log:

Dec 16 12:39:09 ucm node[5469]: 16 Dec 12:39:09 - [info] Starting flows  

Dec 16 12:39:09 ucm node[5469]: 16 Dec 12:39:09 - [info] [azureiotdevice:d2662533.509318] IoTHubDevice_4 -> Initiate IoT Device settings.  

Dec 16 12:39:09 ucm node[5469]: 16 Dec 12:39:09 - [info] [azureiotdevice:d2662533.509318] IoTHubDevice_4 -> Initiate IoT Device connection string.  

Dec 16 12:39:09 ucm node[5469]: 16 Dec 12:39:09 - [info] [azureiotdevice:d2662533.509318] IoTHubDevice_4 -> Provision IoT Device using DPS.  

Dec 16 12:39:10 ucm node[5469]: 16 Dec 12:39:10 - [info] Started flows  

Dec 16 12:39:29 ucm node[5469]: 16 Dec 12:39:29 - [error] [azureiotdevice:d2662533.509318] IoTHubDevice_4 -> Error registering device: {"name":"NotConnectedError"}  

Dec 16 12:56:14 ucm node[5469]: 16 Dec 12:56:14 - [red] Uncaught Exception:  

Dec 16 12:56:14 ucm node[5469]: 16 Dec 12:56:14 - NotConnectedError: rhea: connection disconnected  

Dec 16 12:56:14 ucm systemd[1]: uc-ui-node-red.service: Main process exited, code=exited, status=1/FAILURE
iotblackbelt commented 3 years ago

@dkby: problem resolved. Will be released with version 0.2.1.