Can a failing device stop the Node-Red add-on?

My very first IOT device was a Belkin Wemo outlet (Version 1) and my home IOT was on Node Red. It was almost a year later that I discovered Home Assistant.

So the Belkin outlet was grandfathered into my Home Assistant.

A week ago, and again twice yesterday, my Node-Red add-on sidebar said: “503 Bad Gateway”. I restarted the add-on and Node-Red was running again. The second and third time I copied the log:

1 Mar 18:56:11 - [red] Uncaught Exception:
1 Mar 18:56:11 - [error] Error: connect ETIMEDOUT 192.168.1.12:49153
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[18:56:12] INFO: Service Node-RED exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
[18:56:12] INFO: Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

The second line showed the IP address of the Belkin device, so I unplugged it. And Node Red hasn’t crashed again.

Questions:

  1. Can a failing device crash the Node Red add-on?
  2. The watchdog is turned on- why didn’t it restart the add-on when it crashed?

Yes!
If a piece of code expect to receive something, like a string of max. 16 characters ending with a null character, but the get 128 characters instead, then the reserved space for that string will be exceeded.
This error is called a buffer overflow, but there is a lot of other options also.
When you make programs you can handle some of the expected errors that might happen, like no network available when trying to make a network connection or when trying to write to a file another program have locked, because it wants to write to it too. This handling of errors is called catching exceptions.
The first line in your log snippet here says uncaught exception, which means it is an error that was not thought of being handled.

The second line indicate an error too, but because of the uncaught exception above you can’t really use that to much.
The uncaught exception could be in the Addon code too, like in the module that is communicating with the Belkin device and then the code above it just fails with a time out because of the error in the communication code.