I deployed a flow to my node-red on the raspberry pi 3 and after that it keep restarting giving the following error:

22 Jun 17:26:21 - TypeError: client.subscribeToDeviceCommand is not a function
at Object.callback (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/application/wiotp.js:208:24)
at DeviceClient.<anonymous> (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/application/wiotp.js:51:42)
at emitNone (events.js:86:13)
at DeviceClient.emit (events.js:185:7)
at MqttClient.<anonymous> (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/ibmiotf/dist/clients/DeviceClient.js:109:19)
at emitOne (events.js:101:20)
at MqttClient.emit (events.js:188:7)
at MqttClient._handleConnack (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/mqtt/lib/client.js:790:10)
at MqttClient._handlePacket (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/mqtt/lib/client.js:306:12)
at process (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/mqtt/lib/client.js:248:12)
at Writable.writable._write (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/mqtt/lib/client.js:258:5)
at doWrite (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/readable-stream/lib/_stream_writable.js:401:64)
at writeOrBuffer (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/readable-stream/lib/_stream_writable.js:390:5)
at Writable.write (/usr/lib/node_modules/node-red-contrib-ibm-watson-iot/node_modules/readable-stream/lib/_stream_writable.js:317:11)
at TLSSocket.ondata (_stream_readable.js:555:20)
at emitOne (events.js:96:13)
nodered.service: main process exited, code=exited, status=1/FAILURE
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool....
Starting Node-RED graphical event wiring tool....
Started Node-RED graphical event wiring tool..

and then keep restarting. How should I fix this?

1 Answer 1


I searched the net. It seems that I created a flow with a node that is not fuly configured so I had to remove this flow. I was able to make node-red start again by renaming the flow file.

go to the folder

pi@raspberrypi:~ $cd /home/pi/.node-red/
pi@raspberrypi:~/.node-red $ ls -la
total 56
drwxr-xr-x  4 pi pi  4096 Jun 22 17:20 .
drwxr-xr-x 26 pi pi  4096 Jun 22 17:37 ..
-rw-r--r--  1 pi pi 13283 Jun 21 18:03 .config.json
-rw-r--r--  1 pi pi   100 Jun 22 16:46 flows_raspberrypi_cred.json
-rw-r--r--  1 pi pi  3560 Jun 22 17:20 flows_raspberrypi.json
-rw-r--r--  1 pi pi  3119 Jun 22 16:46 .flows_raspberrypi.json.backup
drwxr-xr-x  3 pi pi  4096 Apr 10 12:20 lib
drwxr-xr-x  4 pi pi  4096 Jun 21 17:59 node_modules
-rw-r--r--  1 pi pi  9064 Jun 21 17:45 settings.js

I renamed the one with flows_raspberrypi.json and then started node-red and it works this time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.