Help debugging "random" node-red-node-ping 0.2.0 crash

Hello all,

Attached is the relevant log. I get these random crashes with the ping node. I looked at the code and there does appear to be an "on" property. I just can't track this down.

Any ideas on how to track this down?

There seems to be an unresolved issue here

Maybe an exec script and remove the use of ping node?

Thanks all!

Jun 21 09:59:36 myPi512 systemd[1]: Starting Cleanup of Temporary Directories...
Jun 21 09:59:36 myPi512 systemd[1]: Started Cleanup of Temporary Directories.
Jun 21 13:40:29 myPi512 Node-RED[257]: 21 Jun 13:40:29 - [red] Uncaught Exception:
Jun 21 13:40:29 myPi512 Node-RED[257]: 21 Jun 13:40:29 - TypeError: Cannot read property 'on' of undefined
Jun 21 13:40:29 myPi512 Node-RED[257]: at doPing (/home/pi/.node-red/node_modules/node-red-node-ping/88-ping.js:53:19)
Jun 21 13:40:29 myPi512 Node-RED[257]: at Timeout._onTimeout (/home/pi/.node-red/node_modules/node-red-node-ping/88-ping.js:105:34)
Jun 21 13:40:29 myPi512 Node-RED[257]: at ontimeout (timers.js:436:11)
Jun 21 13:40:29 myPi512 Node-RED[257]: at tryOnTimeout (timers.js:300:5)
Jun 21 13:40:29 myPi512 Node-RED[257]: at listOnTimeout (timers.js:263:5)
Jun 21 13:40:29 myPi512 Node-RED[257]: at Timer.processTimers (timers.js:223:10)
Jun 21 13:40:29 myPi512 systemd[1]: nodered.service: main process exited, code=exited, status=1/FAILURE
Jun 21 13:40:29 myPi512 systemd[1]: Unit nodered.service entered failed state.
Jun 21 13:40:30 myPi512 systemd[1]: nodered.service holdoff time over, scheduling restart.
Jun 21 13:40:30 myPi512 systemd[1]: Stopping Node-RED graphical event wiring tool...
Jun 21 13:40:30 myPi512 systemd[1]: Starting Node-RED graphical event wiring tool...
Jun 21 13:40:30 myPi512 systemd[1]: Started Node-RED graphical event wiring tool.
Jun 21 13:40:41 myPi512 Node-RED[12620]: 21 Jun 13:40:40 - [info]
Jun 21 13:40:41 myPi512 Node-RED[12620]: Welcome to Node-RED
Jun 21 13:40:41 myPi512 Node-RED[12620]: ===================
Jun 21 13:40:41 myPi512 Node-RED[12620]: 21 Jun 13:40:41 - [info] Node-RED version: v1.0.6
Jun 21 13:40:41 myPi512 Node-RED[12620]: 21 Jun 13:40:41 - [info] Node.js  version: v10.17.0
Jun 21 13:40:41 myPi512 Node-RED[12620]: 21 Jun 13:40:41 - [info] Linux 4.9.35+ arm LE
Jun 21 13:40:46 myPi512 Node-RED[12620]: 21 Jun 13:40:46 - [info] Loading palette nodes
Jun 21 13:41:11 myPi512 Node-RED[12620]: 21 Jun 13:41:11 - [info] Dashboard version 2.22.1 started at /ui
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [info] Settings file  : /home/pi/.node-red/settings.js
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [info] HTTP Static    : /home/pi/public
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [info] Context store  : 'default' [module=memory]
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [info] User directory : /home/pi/.node-red/
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [warn] Projects disabled : editorTheme.projects.enabled=false
Jun 21 13:41:16 myPi512 Node-RED[12620]: 21 Jun 13:41:16 - [info] Flows file     : /home/pi/.node-red/flows_myPi512.json
Jun 21 13:41:17 myPi512 Node-RED[12620]: 21 Jun 13:41:17 - [info] Server now running at http://127.0.0.1:1880/
Jun 21 13:41:18 myPi512 Node-RED[12620]: 21 Jun 13:41:18 - [warn]
Jun 21 13:41:18 myPi512 Node-RED[12620]: ---------------------------------------------------------------------
Jun 21 13:41:18 myPi512 Node-RED[12620]: Your flow credentials file is encrypted using a system-generated key.
Jun 21 13:41:18 myPi512 Node-RED[12620]: If the system-generated key is lost for any reason, your credentials
Jun 21 13:41:18 myPi512 Node-RED[12620]: file will not be recoverable, you will have to delete it and re-enter
Jun 21 13:41:18 myPi512 Node-RED[12620]: your credentials.
Jun 21 13:41:18 myPi512 Node-RED[12620]: You should set your own key using the 'credentialSecret' option in
Jun 21 13:41:18 myPi512 Node-RED[12620]: your settings file. Node-RED will then re-encrypt your credentials
Jun 21 13:41:18 myPi512 Node-RED[12620]: file using your chosen key the next time you deploy a change.
Jun 21 13:41:18 myPi512 Node-RED[12620]: ---------------------------------------------------------------------

Are you using a lot of them?
I got some hard crashes when I had about 20+ of them pinging at different times.
I ended up bumping the times way out, and using prime numbers for the ping rates and the crashes stopped.

Under the hood, the ping node uses exec so I don't think that'd help.

Are you pinging lots of single items in their own ping per node OR multiple items in one ping node?

How often are you pinging?

Are you triggering ping nodes at the same time?

That appears to be a different issue. This one looks as if the spawn has failed in some way. The use of spawn and the failing line look perfectly normal to me, I think it will need an expert to look at it. @dceejay?

will have a look when I get a sec

I think you guys are onto something here. I only have 5 ping nodes in all my flows.

I can't say for sure, but I believe this is the "suspect" flow. Please don't knock it :slight_smile:

It could have something to do with async introduction? I've been running this flow for a long time.

I have a bunch of RGB led wifi devices around and the purpose of this flow is to set global.Internet variable and to set RGB lights around the house to show if internet is up/down? Also checks if a local device is available.

Via inject, every 15min, 5min checks when down. The 5min checks don't stop the 15min inject.

[{"id":"62c9d39f.eaf04c","type":"comment","z":"9fb467d9.e23db","name":"Internet / Intranet","info":"","x":100,"y":2120,"wires":[]},{"id":"bd02b26d.f6d37","type":"is online","z":"9fb467d9.e23db","name":"google.com","url":"google.com","action":"0","x":230,"y":2168,"wires":[["169cb3f0.955afc","957e1d14.8ec448","6c6b0652.a51b88"]]},{"id":"bc01d2f.92447b","type":"inject","z":"9fb467d9.e23db","name":"15m","topic":"","payload":"","payloadType":"str","repeat":"900","crontab":"","once":false,"onceDelay":"","x":90,"y":2180,"wires":[["a0b2e586.82563","bd02b26d.f6d37"]]},{"id":"169cb3f0.955afc","type":"debug","z":"9fb467d9.e23db","name":"","active":true,"console":"false","complete":"online","x":530,"y":2160,"wires":[]},{"id":"a0b2e586.82563","type":"is online","z":"9fb467d9.e23db","name":"local RF bridge","url":"192.168.0.201","action":"0","x":240,"y":2200,"wires":[["169cb3f0.955afc","9938b74.67670c8"]]},{"id":"957e1d14.8ec448","type":"function","z":"9fb467d9.e23db","name":"blink pink","func":"function updateStatus(color,cnt) {\n\tnode.status({\n\t\tfill : color,\n\t\tshape : \"dot\",\n\t\ttext : \"Offline Count: \"+cnt\n\t});\n}\n\n// Reset feature\nif (msg.topic === \"reset\"){\n\tcontext.set('online',true);\n\tcontext.set('offlineCnt',0);\n\tupdateStatus(\"green\",0);\n\treturn [null,null];\n}\n\nvar online=context.get('online');\nvar cnt=context.get('offlineCnt')||0;\nif (isNaN(online)){\n\tonline=true;// Set default\n\tcontext.set('online',online);\n}\n\n// Offline\nif (msg.online === false){\n\tcnt++;\n\tcontext.set('offlineCnt',cnt);\n\tupdateStatus(\"red\",cnt);\n\tmsg.payload=\"rgb(249,4,102,150)\";\n\tcontext.set('online',false);\n\treturn [msg,null];\n}\n// Now online, was offline\nif (msg.online === true && online === false){\n\tupdateStatus(\"green\",cnt);\n\tmsg.payload=\"back online\";\n\tmsg.reset=1;//stop trigger\n\tcontext.set('online',true);\n\treturn [null,msg];\n}\nupdateStatus(\"green\",cnt);","outputs":"2","noerr":0,"x":520,"y":2194,"wires":[["74f27c6d.88a4fc","e5109264.db252"],["db7931af.7e71e","74f27c6d.88a4fc","e5109264.db252"]]},{"id":"9938b74.67670c8","type":"function","z":"9fb467d9.e23db","name":"blink teal","func":"function updateStatus(color,cnt) {\n\tnode.status({\n\t\tfill : color,\n\t\tshape : \"dot\",\n\t\ttext : \"Offline Count: \"+cnt\n\t});\n}\n\n// Reset feature\nif (msg.topic === \"reset\"){\n\tcontext.set('online',true);\n\tcontext.set('offlineCnt',0);\n\tupdateStatus(\"green\",0);\n\treturn null;\n}\n\nvar online=context.get('online');\nvar cnt=context.get('offlineCnt')||0;\nif (isNaN(online)){\n\tonline=true;// Set default\n\tcontext.set('online',online);\n}\n\n// Offline\nif (msg.online === false){\n\tcnt++;\n\tcontext.set('offlineCnt',cnt);\n\tupdateStatus(\"red\",cnt);\n\tmsg.payload=\"rgb(4,233,249,150)\";\n\tcontext.set('online',false);\n\treturn [msg,null];\n}\n// Now online, was offline\nif (msg.online === true && online === false){\n\tupdateStatus(\"green\",cnt);\n\tmsg.payload=\"back online\";\n\tcontext.set('online',true);\n\treturn [null,msg];\n}\nupdateStatus(\"green\",cnt);","outputs":"2","noerr":0,"x":520,"y":2239,"wires":[["e5109264.db252"],["db7931af.7e71e","e5109264.db252"]]},{"id":"db7931af.7e71e","type":"debug","z":"9fb467d9.e23db","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":2160,"wires":[]},{"id":"274f06b0.2bc472","type":"inject","z":"9fb467d9.e23db","name":"","topic":"reset","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"x":270,"y":2240,"wires":[["957e1d14.8ec448","9938b74.67670c8"]]},{"id":"bc877a70.c899d","type":"comment","z":"9fb467d9.e23db","name":"accelerate checks when offline","info":"","x":790,"y":2120,"wires":[]},{"id":"6c6b0652.a51b88","type":"change","z":"9fb467d9.e23db","name":"","rules":[{"t":"set","p":"Internet","pt":"global","to":"online","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2283,"wires":[[]]},{"id":"6d84a3d.85bcadc","type":"debug","z":"9fb467d9.e23db","name":"","active":true,"console":"false","complete":"false","x":270,"y":2300,"wires":[]},{"id":"80fee6d7.d24e9","type":"inject","z":"9fb467d9.e23db","name":"","topic":"","payload":"Internet","payloadType":"global","repeat":"","crontab":"","once":false,"x":110,"y":2300,"wires":[["6d84a3d.85bcadc"]]},{"id":"74f27c6d.88a4fc","type":"delay","z":"9fb467d9.e23db","name":"","pauseType":"rate","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":540,"y":2120,"wires":[["bd02b26d.f6d37"]]},{"id":"e5109264.db252","type":"debug","z":"9fb467d9.e23db","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":2200,"wires":[]}]

Thanks!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.