Node-red crash when network is down?

Hi,

sometimes Node-red is crashing and I think it's when my network is down. I don' know why there is this behaviour. Here are the logs when the crash occurs.

May 11 20:20:00 Home-server node-red[1234]: 11 May 20:20:00 - [info] [exec:Ping @IP routeur bureau] ping  -c 5 192.168.1.93
May 11 20:24:30 Home-server node-red[1234]: 11 May 20:24:30 - [info] [exec:Ping @IP switch] ping  -c 5 192.168.1.64
May 11 20:24:30 Home-server node-red[1234]: 11 May 20:24:30 - [info] [exec:Ping @IP Capteur cuve] ping  -c 5 192.168.1.90
May 11 20:24:30 Home-server node-red[1234]: 11 May 20:24:30 - [error] [rbe:26799aa0.84f586] TypeError: Cannot read property 'req' of null
May 11 20:24:30 Home-server node-red[1234]:     at Object.cloneMessage (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:86:19)
May 11 20:24:30 Home-server node-red[1234]:     at RbeNode.<anonymous> (/usr/lib/node_modules/node-red/node_modules/node-red-node-rbe/rbe.js:36:57)
May 11 20:24:30 Home-server node-red[1234]:     at emitOne (events.js:116:13)
May 11 20:24:30 Home-server node-red[1234]:     at RbeNode.emit (events.js:211:7)
May 11 20:24:30 Home-server node-red[1234]:     at RbeNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:237:14)
May 11 20:24:30 Home-server node-red[1234]:     at ChangeNode.Node.send (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:159:22)
May 11 20:24:30 Home-server node-red[1234]:     at applyRules (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/logic/15-change.js:336:30)
May 11 20:24:30 Home-server node-red[1234]:     at completeApplyingRules (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/logic/15-change.js:297:24)
May 11 20:24:30 Home-server node-red[1234]:     at applyRule (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/logic/15-change.js:326:47)
May 11 20:24:30 Home-server node-red[1234]:     at getFromValue (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/logic/15-change.js:241:44)
May 11 20:24:33 Home-server node-red[1234]: <--- Last few GCs --->
May 11 20:24:33 Home-server node-red[1234]: [1234:0x3b760f0]  3314073 ms: Mark-sweep 124.0 (167.5) -> 123.9 (167.5) MB, 83.9 / 0.0 ms  allocation failure GC in old space requested
May 11 20:24:33 Home-server node-red[1234]: [1234:0x3b760f0]  3314207 ms: Mark-sweep 123.9 (167.5) -> 123.8 (135.0) MB, 118.5 / 0.0 ms  last resort GC in old space requested
May 11 20:24:33 Home-server node-red[1234]: [1234:0x3b760f0]  3314291 ms: Mark-sweep 123.8 (135.0) -> 123.8 (135.0) MB, 83.4 / 0.0 ms  last resort GC in old space requested
May 11 20:24:33 Home-server node-red[1234]: <--- JS stacktrace --->
May 11 20:24:33 Home-server node-red[1234]: ==== JS stack trace =========================================
May 11 20:24:33 Home-server node-red[1234]: Security context: 0x1215160a58b9 <JSObject>
May 11 20:24:33 Home-server node-red[1234]:     2: close [/home/patrick/.node-red/node_modules/sax/lib/sax.js:157] [bytecode=0x3935b6ea679 offset=10](this=0x25ca3114e299 <SAXParser map = 0x15705af8e071>)
May 11 20:24:33 Home-server node-red[1234]:     3: parseString [/home/patrick/.node-red/node_modules/xml2js/lib/parser.js:322] [bytecode=0x3935b6b7561 offset=202](this=0x25ca3114e399 <Parser map = 0x3cd9ddc57c31>,str=0x225fdbd02201 <Very long string[1970178]>,cb=0x25ca3114e351 <JSF...
May 11 20:24:33 Home-server node-red[1234]: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
May 11 20:24:33 Home-server node-red[1234]:  1: node::Abort() [node-red]
May 11 20:24:33 Home-server node-red[1234]:  2: 0x8ccf9c [node-red]
May 11 20:24:33 Home-server node-red[1234]:  3: v8::Utils::ReportOOMFailure(char const*, bool) [node-red]
May 11 20:24:33 Home-server node-red[1234]:  4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node-red]
May 11 20:24:33 Home-server node-red[1234]:  5: v8::internal::Factory::NewCode(v8::internal::CodeDesc const&, unsigned int, v8::internal::Handle<v8::internal::Object>, bool, int) [node-red]
May 11 20:24:33 Home-server node-red[1234]:  6: v8::internal::CodeGenerator::MakeCodeEpilogue(v8::internal::TurboAssembler*, v8::internal::EhFrameWriter*, v8::internal::CompilationInfo*, v8::internal::Handle<v8::internal::Object>) [node-red]
May 11 20:24:33 Home-server node-red[1234]:  7: v8::internal::compiler::CodeGenerator::FinalizeCode() [node-red]
May 11 20:24:33 Home-server node-red[1234]:  8: v8::internal::compiler::PipelineImpl::FinalizeCode() [node-red]
May 11 20:24:33 Home-server node-red[1234]:  9: v8::internal::compiler::PipelineCompilationJob::FinalizeJobImpl() [node-red]
May 11 20:24:33 Home-server node-red[1234]: 10: v8::internal::CompilationJob::FinalizeJob() [node-red]
May 11 20:24:33 Home-server node-red[1234]: 11: 0xd2b38a [node-red]
May 11 20:24:33 Home-server node-red[1234]: 12: v8::internal::Compiler::CompileOptimized(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::ConcurrencyMode) [node-red]
May 11 20:24:33 Home-server node-red[1234]: 13: v8::internal::Runtime_CompileOptimized_NotConcurrent(int, v8::internal::Object**, v8::internal::Isolate*) [node-red]
May 11 20:24:33 Home-server node-red[1234]: 14: 0x15b0104042fd
May 11 20:24:56 Home-server systemd[1]: node-red.service: Main process exited, code=dumped, status=6/ABRT
May 11 20:24:56 Home-server systemd[1]: node-red.service: Unit entered failed state.
May 11 20:24:56 Home-server systemd[1]: node-red.service: Failed with result 'core-dump'.
May 11 20:24:56 Home-server systemd[1]: node-red.service: Service hold-off time over, scheduling restart.
May 11 20:24:56 Home-server systemd[1]: Stopped Node-RED.
May 11 20:24:56 Home-server systemd[1]: Started Node-RED.
May 11 20:24:57 Home-server node-red[14107]: 11 May 20:24:57 - [info]
May 11 20:24:57 Home-server node-red[14107]: Welcome to Node-RED
May 11 20:24:57 Home-server node-red[14107]: ===================
May 11 20:24:57 Home-server node-red[14107]: 11 May 20:24:57 - [info] Node-RED version: v0.20.3
May 11 20:24:57 Home-server node-red[14107]: 11 May 20:24:57 - [info] Node.js  version: v8.15.1

It crashes on the rbe node, can you post your flow?

What kind of data are you sending data through the rbe node ?

I don't think it is in the rbe node because I had always this error (every 5mn because the flow is running every 5mn) and node-red did not not crash before the network was down. Morever I have just fixed this error by adding a conversion node (JSON string to object) before rbe.
Here is my flow in case of necesary. The flow controls sunset based hour to switch off light.

[{"id":"96a299b5.58d4a8","type":"inject","z":"1819a8d9.d55ac7","name":"Poll 5mn","topic":"","payload":"","payloadType":"date","repeat":"300","crontab":"","once":false,"onceDelay":0.1,"x":113.00016021728516,"y":1339.0001993179321,"wires":[["3e7aafaa.a840b","94428203.6d439","4465071.104dff8","7b291b0b.7689f4","cc53c440.885c08","eb3c90a0.951e9","599025ce.b60c7c"]]},{"id":"eb3c90a0.951e9","type":"change","z":"1819a8d9.d55ac7","name":"Contrôle critères extinction éclairage terrasse/jardin","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* Critères de gestion extinction terrasse/salon */\t(\t/* Détermination si soirée */\t   (\t       $globalContext('soiree') = true\t   ) and (\t   $toMillis($now()) > (($globalContext('sunset')+6900)*1000))\t) ? {\"value\":false} : null","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"Extinction terrasse & jardin à sunset +2h","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":436,"y":1913.2668228149414,"wires":[["375b7e0f.d339a2"]]},{"id":"375b7e0f.d339a2","type":"json","z":"1819a8d9.d55ac7","name":"","property":"payload","action":"","pretty":false,"x":716.0000343322754,"y":1910.0667514801025,"wires":[["26799aa0.84f586"]]},{"id":"26799aa0.84f586","type":"rbe","z":"1819a8d9.d55ac7","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":855.0001029968262,"y":1907.2667484283447,"wires":[["f68aae30.8949e","fe4c2103.28d77"]]},{"id":"f68aae30.8949e","type":"function","z":"1819a8d9.d55ac7","name":"Timer/clignotement","func":"if (msg.payload !== null)\n{\nmsg['payload'] = '{\"value\":false}';\nnode.send(msg);\nsetTimeout(function(){\n    msg['payload'] = '{\"value\":true}';\n    node.send(msg);\n}, 5000);\nsetTimeout(function(){\n    msg['payload'] = '{\"value\":false}';\n    node.send(msg);\n}, 30000);\n}","outputs":1,"noerr":0,"x":1047.3003005981445,"y":1904.001124382019,"wires":[["e9666c4c.adcb9","1c9e083a.3c3a48"]]},{"id":"1c9e083a.3c3a48","type":"mqtt out","z":"1819a8d9.d55ac7","name":"Eclairage jardin","topic":"request/attributes/b2f953ba-6146-41f2-a91d-b16256a8db6c/value","qos":"","retain":"","broker":"c4ddd8f2.c3aa3","x":1272.9997940063477,"y":1940.9334173202515,"wires":[]},{"id":"c4ddd8f2.c3aa3","type":"mqtt-broker","z":"","broker":"192.168.1.92","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]