Since I upgraded node red to 10.2.0 node-red crashes and restarts (not by watchdog, it restarts in the container itself) over and over again. I then set all flows to disabled directly in the flows.json and activated the flows one after another until it crashed again. In the suspicious flow, I again started with all nodes deactivated and activated again one after another until it crashed.
The node that made node-red crash was a Home Assistant “entity” node. But the wired thing was, it is not the only “entity”-node in this flow. The other two have been activated before without crashing.
The code of the crashing node is as follows.
[{"id":"02efef8caeccc6c7","type":"ha-entity","z":"3079ee36.02c2d2","d":true,"name":"OilFox Liters Delta","server":"fbb2f3e2.d6216","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"l"}],"state":"payload","stateType":"msg","attributes":[{"property":"timeSinceChangedHours","value":"$round(data.timeSinceChangedMs / (1000 * 60 * 60), 1)","valueType":"jsonata"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":450,"y":540,"wires":[["1dfde7880bd0708c","7a5849945ad55047"]]},{"id":"fbb2f3e2.d6216","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]
This is what is written in the Log of node-red in supervisor:
6 Dec 00:01:55 - [red] Uncaught Exception:
6 Dec 00:01:55 - [error] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
[00:01:55] INFO: Starting Node-RED...
Does anybody have an idea, what is going wrong here and why it is only happening with this special node?
Thanks for any guidance in advance.