node-red-node-pushbullet : Node-Red restart on "TypeError: Cannot read property 'title' of undefined"
Which node are you reporting an issue on?
- node-red-node-pushbullet version 0.0.17
What are the steps to reproduce?
- Don't know if it's possible to reproduce on Node-Red "from scratch"
What happens?
- Node-red restart when receiving a pushbullet notification. I'm not sure it's on each notification.
- Log in "/var/daemon.log" are :
Jul 30 12:15:57 localserver Node-RED[115708]: 30 Jul 12:15:57 - [red] Uncaught Exception:
Jul 30 12:15:57 localserver Node-RED[115708]: 30 Jul 12:15:57 - [error] TypeError: Cannot read property 'title' of undefined
Jul 30 12:15:57 localserver Node-RED[115708]: at PushbulletConfig.pushMsg (/root/.node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:236:60)
Jul 30 12:15:57 localserver Node-RED[115708]: at Stream.<anonymous> (/root/.node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:119:26)
Jul 30 12:15:57 localserver Node-RED[115708]: at Stream.emit (events.js:400:28)
Jul 30 12:15:57 localserver Node-RED[115708]: at WebSocket.<anonymous> (/root/.node-red/node_modules/pushbullet/lib/internal/stream.js:54:8)
Jul 30 12:15:57 localserver Node-RED[115708]: at WebSocket.emit (events.js:400:28)
Jul 30 12:15:57 localserver Node-RED[115708]: at Receiver.receiverOnMessage (/root/.node-red/node_modules/ws/lib/websocket.js:789:20)
Jul 30 12:15:57 localserver Node-RED[115708]: at Receiver.emit (events.js:400:28)
Jul 30 12:15:57 localserver Node-RED[115708]: at Receiver.dataMessage (/root/.node-red/node_modules/ws/lib/receiver.js:422:14)
Jul 30 12:15:57 localserver Node-RED[115708]: at Receiver.getData (/root/.node-red/node_modules/ws/lib/receiver.js:352:17)
Jul 30 12:15:57 localserver Node-RED[115708]: at Receiver.startLoop (/root/.node-red/node_modules/ws/lib/receiver.js:138:22)
Jul 30 12:15:58 localserver systemd[1]: Stopped Node-RED graphical event wiring tool.
Jul 30 12:15:58 localserver systemd[1]: Started Node-RED graphical event wiring tool.
Jul 30 12:16:08 localserver Node-RED[298352]: 30 Jul 12:16:08 - [info]
Jul 30 12:16:08 localserver Node-RED[298352]: Welcome to Node-RED
- previously I only use "pushbullet" node with no trouble on Node-Red stability. Issue appeared since I use "pushbullet in".
- I add "title" value in every "pushbullet" node I use with no significant impact
- For exemple, Node-Red crash on Notification from my smartphone
What do you expect to happen?
- No Node-Red restart
Please tell us about your environment:
- [x] Node-RED version: v3.0.1
- [x] node.js version: v14.17.6
- [x] npm version: 7.24.0
- [x] Platform/OS: Debian GNU/Linux 11 (bullseye)
- [x] Browser: Mozilla Firefox Snap for Ubuntu (102.0.1) but probably not concerned.
PS : Thank's for your wonderfull work !
Having the same problem. Uninstalled for now, but would be great if the devs could take a look at this as I have no other way to get SMS in messages to NodeRed for automation processing. Thanks,.
I'm having the same issue: I'll use a different notification method for now.
17 Aug 14:24:09 - [error] TypeError: Cannot read properties of undefined (reading 'title')
at PushbulletConfig.pushMsg (/config/node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:236:60)
at Stream.
Hi @dougle03, @T2evh
which version of the pushbullet node are you using ?
The weird thing is the lines mentioned in the error don't seem to match anything useful in latest source.

Can you copy those relevant lines here so i can try to match them up (lines 236 and 119) Thanks
At a guess, @dougle03 mentions SMS and line 224 in the code looks like it could definitely throw that error...
https://github.com/node-red/node-red-nodes/blob/c1c82a623e01992e2862d68e65fcc306dd9bcdd1/social/pushbullet/57-pushbullet.js#L224
incoming.notifications[0] is not sanity checked before accessing .title and .body
Hi @dougle03, @T2evh
which version of the pushbullet node are you using ? The weird thing is the lines mentioned in the error don't seem to match anything useful in latest source.
Can you copy those relevant lines here so i can try to match them up (lines 236 and 119) Thanks
I'm using version 0.0.17. I'll attempt to look up the lines of code later today. Thanks for your help
I'm using version 0.0.17. I'll attempt to look up the lines of code later today.
No need really - you are already on the latest version (same as master branch - see here)
For background information. I'm using Node Red with Home Assistant (home automation software). I use node red for scripting alerts, such as post arrived or car charged etc. I thought I'd disabled every pushbullet node, but looks like I missed one. So far node red has not crashed yet. I can look at enabling one node at a time to see which scenario is causing the crash
Ah right yes sms... Any chance either of you could add a line before the one Steve mentions (224) to be
console.log("INCOMING:",incoming);
msg.topic = "SMS: "+ incoming.notifications[0].title;
So we can see what that incoming message really looks like ? in the log
Easy enough to stop it failing but would rather try to d something sensible if we can...
Ah right yes sms... Any chance either of you could add a line before the one Steve mentions (224) to be
console.log("INCOMING:",incoming); msg.topic = "SMS: "+ incoming.notifications[0].title;So we can see what that incoming message really looks like ? in the log
Easy enough to stop it failing but would rather try to d something sensible if we can...
Yes happy to help, but you could you provide the path of the module you want me to edit. I assume its somewhere below node-red/node_modules/pushbullet?
Thanks Trevor
Most likely userDir/node_modules/node-red-node-pushbullet where userDir is logged early in the Node-RED startup (looks
like /.node-red from the earlier comments)
OK console added to code, but on my code it's line 236. Not sure why if we are on same version 0.0.17,but thought I'd flag it, in case relevant. It may be a few hours before it crashes

Yes correct. We sit and await.
I don’t use SMS in my scripts. I use push notifications to my devices. I've run a few pushbullet notifications script's in node red but don't see those in the log. I'm no expert but it may not be specific to SMS. I'll look to add more log lines to the java.
OK its crashed and here is the log...
INCOMING: { type: 'sms_changed', source_device_iden: 'ujCbp1WR3Cusjw1nY709wO', notifications: [] } 20 Aug 11:10:02 - [red] Uncaught Exception: 20 Aug 11:10:02 - [error] TypeError: Cannot read properties of undefined (reading 'title') at PushbulletConfig.pushMsg (/config/node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:237:60) at Stream.
Pushed a fix as version 0.0.19 please check and let us know . Thanks for your help.