Hello everyone, it seems that my Node-Red is restarting in an unwanted way.
That makes me unhappy, because it clears all chart data and history.
It runs on a raspian with a Raspi4.
After a restart, I've got : node-red-log
15 May 11:02:44 - [info] [googlehome-intent:Sais_faire] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Lis_alerte] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_message] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_alerte] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Lis_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Liste_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Envoi_email] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Envoi_message_fallback] [object Obje ct]
15 May 11:02:44 - [info] serial port /dev/ttyUSB0 opened at 57600 baud 8N1
15 May 11:02:44 - [info] [googlehome-ask:1fc8659c.de400a] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f26de917.8e8788] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:3c41c9af.5f0886] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:d901b241.231ec] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:44281757.30d658] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f0038966.363af8] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:7173bf4e.70a07] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:61db9e17.d5805] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:9a0f6c73.23c5e] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:8df419b5.f9b978] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f13ae382.969c2] [object Object]
15 May 11:02:44 - [warn] [pushbullet-config:APIPUSHBULLET] Unable to get history .
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tu lpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
What we need to see is the log output from just before and during the restart, to see why it stopped. The node-red-log command only shows the most recent messages. You can get further back in the log using, for example journalctl -n 100 -u nodered --no-pager -o cat
which will show the last 100 lines. When you post it here include the restart up to the point where it has got fully going.
Thanks very much Colin. Here it is (it seems to be a problem with my PushBullet
node :journalctl -n 500 -u nodered --no-pager -o cat
15 May 10:57:45 - [info] [googlehome-ask:f26de917.8e8788] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:3c41c9af.5f0886] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:d901b241.231ec] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:44281757.30d658] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:f0038966.363af8] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:7173bf4e.70a07] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:61db9e17.d5805] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:9a0f6c73.23c5e] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:8df419b5.f9b978] [object Object]
15 May 10:57:45 - [info] [googlehome-ask:f13ae382.969c2] [object Object]
15 May 10:57:45 - [warn] [pushbullet-config:APIPUSHBULLET] Unable to get history.
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
15 May 11:02:17 - [red] Uncaught Exception:
15 May 11:02:17 - TypeError: Cannot read property 'title' of undefined
at PushbulletConfig.pushMsg (/home/pi/.node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:236:60)
at Stream.<anonymous> (/home/pi/.node-red/node_modules/node-red-node-pushbullet/57-pushbullet.js:119:26)
at Stream.emit (events.js:314:20)
at WebSocket.<anonymous> (/home/pi/.node-red/node_modules/pushbullet/lib/internal/stream.js:54:8)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/home/pi/.node-red/node_modules/pushbullet/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:314:20)
at Receiver.dataMessage (/home/pi/.node-red/node_modules/pushbullet/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/pi/.node-red/node_modules/pushbullet/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/pi/.node-red/node_modules/pushbullet/node_modules/ws/lib/receiver.js:138:22)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 31.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
15 May 11:02:38 - [info]
Welcome to Node-RED
===================
15 May 11:02:38 - [info] Node-RED version: v1.2.6
15 May 11:02:38 - [info] Node.js version: v12.20.0
15 May 11:02:38 - [info] Linux 5.4.79-v7l+ arm LE
15 May 11:02:39 - [info] Loading palette nodes
15 May 11:02:42 - [info] Dashboard version 2.26.0 started at /nodered/ui
15 May 11:02:43 - [info] Settings file : /home/pi/.node-red/settings.js
15 May 11:02:43 - [info] HTTP Static : /home/pi/.node-red/public
15 May 11:02:43 - [info] Context store : 'default' [module=memory]
15 May 11:02:43 - [info] User directory : /home/pi/.node-red
15 May 11:02:43 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 May 11:02:43 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
15 May 11:02:43 - [info] Server now running at http://127.0.0.1:1990/nodered/
15 May 11:02:43 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
15 May 11:02:43 - [info] Starting flows
GoogleHomeControllerNode
{
id: '75115323.60b45c',
type: 'googlehome-controller',
z: '3180bdba.53bec2',
name: '',
x: 190,
y: 620,
wires: [
[
'e231bac0.fdaea8',
'8079256e.9f7518',
'ca4019ec.f52788',
'424e1a10.5f4f14',
'65a32418.2944dc',
'3a74b377.a9358c',
'76d399c8.05f118',
'5b619b1d.0b6004',
'18c21be7.23f7c4',
'500e004e.fb802',
'ad38db27.3f34b8'
],
[ 'a7b2fe32.13519' ]
]
}
15 May 11:02:43 - [warn] [RED.events] Deprecated use of "nodes-started" event from "/home/pi/.node-red/node_modules/node-red-contrib-googlehome-a ctions-v2/googlehome/googlehome-controller.js:27:20". Use "flows:started" instead.
GoogleHomeIntentNode
{
id: 'e231bac0.fdaea8',
type: 'googlehome-intent',
z: '3180bdba.53bec2',
name: 'Lis_message',
intent: 'Lis_message',
x: 520,
y: 740,
wires: [ [ '1fc8659c.de400a' ] ]
}
GoogleHomeAskNode
{
id: '1fc8659c.de400a',
**…. very long json message. I cut it to make the report easier to read**
**NB : I don’t why the GoogleHome Node logs this kind of information**
GoogleHomeAskNode
{
id: 'f13ae382.969c2',
type: 'googlehome-ask',
z: '3180bdba.53bec2',
name: '',
message: 'Rien',
x: 770,
y: 300,
wires: [ [ '672febc4.c3c074', '710939e8.6c6398' ] ]
}
15 May 11:02:43 - [info] [googlehome-controller:75115323.60b45c] Sending Controller
15 May 11:02:43 - [info] Started flows
15 May 11:02:44 - [info] [googlehome-intent:Lis_message] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Status] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Sais_faire] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Lis_alerte] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_message] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_alerte] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Lis_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Repete_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Liste_recette] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Envoi_email] [object Object]
15 May 11:02:44 - [info] [googlehome-intent:Envoi_message_fallback] [object Object]
15 May 11:02:44 - [info] serial port /dev/ttyUSB0 opened at 57600 baud 8N1
15 May 11:02:44 - [info] [googlehome-ask:1fc8659c.de400a] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f26de917.8e8788] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:3c41c9af.5f0886] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:d901b241.231ec] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:44281757.30d658] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f0038966.363af8] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:7173bf4e.70a07] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:61db9e17.d5805] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:9a0f6c73.23c5e] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:8df419b5.f9b978] [object Object]
15 May 11:02:44 - [info] [googlehome-ask:f13ae382.969c2] [object Object]
15 May 11:02:44 - [warn] [pushbullet-config:APIPUSHBULLET] Unable to get history.
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/netstat -tulpn
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
My PushBullet node seems to generate an uncaught exception : cannot red property 'title' of undefined. However, just after the pushbullet node, I've got a function which tests if the message is undefined :if (typeof msg.payload != 'undefined' && msg.payload !== null) {...}. Ayn idea ?
I have fixed the formatting of your log so that it is easier to read. For the future, if posting flows, code or logs it is best to use the technique described in this post: How to share code or flow json
Yes, that is why it has crashed. I would first check that you are using the latest version of the node (0.0.17) and also, if possible, upgrade node-red to the latest, though it is less likely to be that.
If you still get the problem then you should submit an issue on the node's github page as it should be fixed.
As to why it is doing it, it is probably something you are sending to the node, so add a debug showing what is going into that node and check it looks ok. A check after the node will not help as it has already crashed by the time the message would get to there.
Thanks very much Colin. I've found the problem. Sometimes I've got undefined msg to pushbullet node which cause nodered crash. I put a filter to eliminate undefined msg. It works fine now. Thank you again.
How can you get an undefined message? Or do you mean the payload is undefined.
Please submit an issue against the node explaining how to cause the crash. Whatever you do it should not crash node-red. Getting it fixed will prevent someone else getting into the same problem.
The payload was indeed undefined sometimes. I don't know why because it is an incoming node created for pushbullet message reception. So, what I did was to initiliaze correctly the payload if necessary : var myMsg={payload : msg.payload || "0"}; and then I used myMsg instead of msg.