Node-red stopped working?

Thanks both - I was looking in entirely the wrong place :roll_eyes:
Hmm - lots of choices ...

Ok, I've upgraded, but still have this Twitter problem. Is it a viable option to 'trim out' the Twitter references from the flow code directly ?

pi@raspberrypi:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.40:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
Started Node-RED graphical event wiring tool.
2 Jun 12:57:23 - [info]
Welcome to Node-RED

2 Jun 12:57:23 - [info] Node-RED version: v0.20.5
2 Jun 12:57:23 - [info] Node.js version: v10.16.0
2 Jun 12:57:23 - [info] Linux 4.9.35-v7+ arm LE
2 Jun 12:57:25 - [info] Loading palette nodes
2 Jun 12:57:35 - [info] Worldmap version 2.0.12
2 Jun 12:57:39 - [info] Dashboard version 2.15.4 started at /ui
2 Jun 12:57:41 - [info] Settings file : /home/pi/.node-red/settings.js
2 Jun 12:57:41 - [info] Context store : 'default' [module=memory]
2 Jun 12:57:41 - [info] User directory : /home/pi/.node-red
2 Jun 12:57:41 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
2 Jun 12:57:41 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
2 Jun 12:57:41 - [info] Server now running at http://127.0.0.1:1880/
2 Jun 12:57:41 - [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.

2 Jun 12:57:41 - [info] Waiting for missing types to be registered:
2 Jun 12:57:41 - [info] - twitter-credentials (provided by npm module node-red-node-twitter)
2 Jun 12:57:41 - [info] - twitter out (provided by npm module node-red-node-twitter)
2 Jun 12:57:41 - [info] To install any of these missing modules, run:
2 Jun 12:57:41 - [info] npm install
2 Jun 12:57:41 - [info] in the directory:
2 Jun 12:57:41 - [info] /home/pi/.node-red
^Cpi@raspberrypi:~ $ sudo npm install node-red-node-twitter
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

  • node-red-node-twitter@1.1.4
    updated 1 package and audited 363 packages in 10.283s
    found 28 vulnerabilities (19 moderate, 9 high)
    run npm audit fix to fix them, or npm audit for details
    pi@raspberrypi:~ $
  1. don't use sudo to install unless it tells you to.

  2. if you are installing on the command line you need to be in your .node-red directory

The log actually tells you what you should do...

2 Jun 12:57:41 - [info] To install any of these missing modules, run:
2 Jun 12:57:41 - [info] npm install
2 Jun 12:57:41 - [info] in the directory:
2 Jun 12:57:41 - [info] /home/pi/.node-red

1 Like

point taken !

pi@raspberrypi:~ cd /home/pi/.node-red pi@raspberrypi:~/.node-red npm install node-red-node-twitter
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

  • node-red-node-twitter@1.1.4

I'm at a loss to what to do now NR just hangs with this

pi@raspberrypi:~/.node-red $ node-red-start
Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.40:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
Started Node-RED graphical event wiring tool.
2 Jun 17:06:21 - [info]
Welcome to Node-RED

2 Jun 17:06:21 - [info] Node-RED version: v0.20.5
2 Jun 17:06:21 - [info] Node.js version: v10.16.0
2 Jun 17:06:21 - [info] Linux 4.9.35-v7+ arm LE
2 Jun 17:06:23 - [info] Loading palette nodes
2 Jun 17:06:32 - [info] Worldmap version 2.0.12
2 Jun 17:06:33 - [info] Dashboard version 2.15.4 started at /ui
2 Jun 17:06:35 - [info] Settings file : /home/pi/.node-red/settings.js
2 Jun 17:06:35 - [info] Context store : 'default' [module=memory]
2 Jun 17:06:35 - [info] User directory : /home/pi/.node-red
2 Jun 17:06:35 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
2 Jun 17:06:35 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
2 Jun 17:06:35 - [info] Server now running at http://127.0.0.1:1880/
2 Jun 17:06:36 - [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.

2 Jun 17:06:36 - [info] Starting flows
2 Jun 17:06:37 - [info] [worldmap:e42e6694.f61568] started at /worldmap
2 Jun 17:06:37 - [error] [twitter out:Tweet] missing twitter credentials
added 22 packages from 33 contributors and audited 2246 packages in 38.054s
found 30 vulnerabilities (21 moderate, 9 high)
run npm audit fix to fix them, or npm audit for details

Thereā€™s nothing in the log that suggests the Node-RED has hung.

But your flow contains a twitter out node, that you need to re-add your credentials to because twitter changed their API

I wish I could, I tried to load the Twitter node but the credentials is greyed out.

It just dawned on me, I assumed the Twitter node would pick the old creds obviously not. I just looked at the Twitter to get the API and it appears they want a load of info to get the API?

greyed out

As I posted in my previous message...

Your image show the manage palette screen (where you can install or uninstall nodes) this isn't where you configure nodes. What do you see when you double click on the twitter node in your flow

1 Like

I deleted the only node I had used and it still shows the error, none of the flows contain any reference to twitter

I just registered for a new Twiiter API (that's changed a lot !) and see how that goes ...

Which error? Post the startup flow you get now.

Check the configation tab in the sidebar and see if you have any orphan twitter configurations you should delete.
config

Another go this morning, I've placed the old working flow (flows.raspberrypi.json) and that works ok. I replaced it with the non working one and it'll hang, this is the output from node-red-log

pi@raspberrypi:~ $ node-red-log

3 Jun 09:20:44 - [info] Node-RED version: v0.20.5
3 Jun 09:20:44 - [info] Node.js version: v10.16.0
3 Jun 09:20:44 - [info] Linux 4.9.35-v7+ arm LE
3 Jun 09:20:47 - [info] Loading palette nodes
3 Jun 09:21:05 - [info] Worldmap version 2.0.12
3 Jun 09:21:08 - [info] Dashboard version 2.15.4 started at /ui
3 Jun 09:21:12 - [info] Settings file : /home/pi/.node-red/settings.js
3 Jun 09:21:12 - [info] Context store : 'default' [module=memory]
3 Jun 09:21:12 - [info] User directory : /home/pi/.node-red
3 Jun 09:21:12 - [warn] Projects disabled : set editorTheme.projects.enabled=tru e to enable
3 Jun 09:21:12 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.js on
3 Jun 09:21:12 - [info] Server now running at http://127.0.0.1:1880/
3 Jun 09:21:12 - [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.

3 Jun 09:21:12 - [info] Starting flows
3 Jun 09:21:14 - [info] [worldmap:e42e6694.f61568] started at /worldmap
3 Jun 09:21:14 - [error] [twitter out:Tweet] missing twitter credentials

When you 'replaced it with the non working one' how do you do this?
Are both flows called flows.raspberrypi.json?
If you are copyingflows.raspberrypi.json from another location back to the /home/pi/.node-red folder do you also copy the flows.raspberrypi_cred.json file too?

If both flows have the same name and you are not copying the creds file, the non working copy will use the same cred's file as the working one which could be causing some problems.

To avoid this, you could (1) enable projects and put each copy in a seperate project or (2) make sure to backup ad restore both flows.raspberrypi.json and flows.raspberrypi_cred.json or (3) rename one of the flows (and it's cred file) and start node-red using node-red this-works.json and node-red this-is-broken.json which will create differently named json files for the flows and cred's.

1 Like

I suffix the old and new with XXX and ZZZ also the credentials XXX and ZZZ and tried swapping creds with both.

have you tried running in safe mode at startup?
From the 0.20 release blog entry:

  • Add --safe mode flag to allow starting without flows running. This can be used if a flow is causing Node-RED to crash - starting in safe mode will allow the editor to be used to modify the flow and then deploy the change to take it out of safe mode.

Then checking out the credentials?

1 Like

Would that be node-red-start --safemode ?

Just found out node-red --safe That gave

pi@raspberrypi:~ $ node-red --safe
3 Jun 11:26:34 - [info]

Welcome to Node-RED

3 Jun 11:26:34 - [info] Node-RED version: v0.20.5
3 Jun 11:26:34 - [info] Node.js version: v10.16.0
3 Jun 11:26:34 - [info] Linux 4.9.35-v7+ arm LE
3 Jun 11:26:36 - [info] Loading palette nodes
3 Jun 11:26:48 - [info] Worldmap version 2.0.12
3 Jun 11:26:50 - [info] Dashboard version 2.15.4 started at /ui
3 Jun 11:26:53 - [info] Settings file : /home/pi/.node-red/settings.js
3 Jun 11:26:53 - [info] Context store : 'default' [module=memory]
3 Jun 11:26:53 - [info] User directory : /home/pi/.node-red
3 Jun 11:26:53 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
3 Jun 11:26:53 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
3 Jun 11:26:53 - [error] Unable to listen on http://127.0.0.1:1880/
3 Jun 11:26:53 - [error] Error: port in use
pi@raspberrypi:~ $

Got it in safemode mode mode after node-red-stop then node-red --safe thanks !!

I can now see and export my 18 (full) pages of flows

It pays to keep an eye on the blog :stuck_out_tongue:

1 Like

I think you're right.

I think now the best way forward would be to start over from fresh. I deleted all flows from the non working file and imported one json file from the export to bring all my flows back. However, that reviled a lot of missing node types which can't appear to be reinstalled - I get tons of permission errors.

So how would I reinstall or refresh node-red and also bulk install the missing node types.

There should be no need to re-install, this is not Windows.
First you need to address the permissions issue. Show us what you are doing and what the error is.
[Edit] If you have the files package.json and package-lock.json that went with the flow you have restored then the command
npm install
should install all the nodes requested there.

I tried to reinstall 'worldmap' from within node-red. Part of the error I get is - it's very long ...
Clearly it's a permission issue that's why I thought it best to start over with fresh, clean node-red without any issues from legacy files.

2019-06-03T13:21:56.345Z [err] npm
2019-06-03T13:21:56.346Z [err] WARN checkPermissions
2019-06-03T13:21:56.346Z [err] Missing write access to /home/pi/.node-red/node_modules/node-red-contrib-schedex/node_modules
2019-06-03T13:21:56.346Z [err] npm
2019-06-03T13:21:56.346Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/object-copy/node_modules
2019-06-03T13:21:56.347Z [err] npm WARN
2019-06-03T13:21:56.347Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/object-copy/node_modules/is-descriptor/node_modules
2019-06-03T13:21:56.347Z [err] npm WARN
2019-06-03T13:21:56.347Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/prebuild-install/node_modules
2019-06-03T13:21:56.348Z [err] npm WARN
2019-06-03T13:21:56.348Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/prompt-choices/node_modules
2019-06-03T13:21:56.348Z [err] npm WARN
2019-06-03T13:21:56.349Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/prompt-question/node_modules
2019-06-03T13:21:56.349Z [err] npm WARN
2019-06-03T13:21:56.349Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/radio-symbol/node_modules
2019-06-03T13:21:56.349Z [err] npm
2019-06-03T13:21:56.349Z [err] WARN checkPermissions
2019-06-03T13:21:56.350Z [err] Missing write access to /home/pi/.node-red/node_modules/readline-ui/node_modules
2019-06-03T13:21:56.350Z [err] npm
2019-06-03T13:21:56.350Z [err] WARN checkPermissions
2019-06-03T13:21:56.350Z [err] Missing write access to /home/pi/.node-red/node_modules/readline-utils/node_modules
2019-06-03T13:21:56.350Z [err] npm
2019-06-03T13:21:56.350Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/send/node_modules
2019-06-03T13:21:56.351Z [err] npm
2019-06-03T13:21:56.351Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/serialport/node_modules/@serialport
2019-06-03T13:21:56.351Z [err] npm
2019-06-03T13:21:56.352Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/shallow-clone/node_modules
2019-06-03T13:21:56.352Z [err] npm
2019-06-03T13:21:56.352Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/socket.io-parser/node_modules
2019-06-03T13:21:56.352Z [err] npm
2019-06-03T13:21:56.353Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules
2019-06-03T13:21:56.353Z [err] npm WARN
2019-06-03T13:21:56.353Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/static-extend/node_modules
2019-06-03T13:21:56.354Z [err] npm WARN
2019-06-03T13:21:56.354Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/static-extend/node_modules/is-data-descriptor/node_modules
2019-06-03T13:21:56.354Z [err] npm
2019-06-03T13:21:56.355Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/terminal-paginator/node_modules
2019-06-03T13:21:56.355Z [err] npm
2019-06-03T13:21:56.355Z [err] WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/util/node_modules
2019-06-03T13:21:56.356Z [err] npm WARN
2019-06-03T13:21:56.356Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/window-size/node_modules
2019-06-03T13:21:56.356Z [err] npm WARN
2019-06-03T13:21:56.356Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/node-red-contrib-alexa-home-skill/node_modules/body-parser/node_modules/raw-body/node_modules
2019-06-03T13:21:56.357Z [err] npm WARN
2019-06-03T13:21:56.357Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/prompt-checkbox/node_modules
2019-06-03T13:21:56.357Z [err] npm WARN
2019-06-03T13:21:56.357Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/choices-separator/node_modules
2019-06-03T13:21:56.358Z [err] npm WARN
2019-06-03T13:21:56.358Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/send/node_modules/debug
2019-06-03T13:21:56.358Z [err] npm WARN
2019-06-03T13:21:56.359Z [err] checkPermissions Missing write access to /home/pi/.node-red/node_modules/prompt-actions/node_modules
2019-06-03T13:21:56.359Z [err] npm
2019-06-03T13:21:56.359Z [err] WARN checkPermissions
2019-06-03T13:21:56.359Z [err] Missing write access to /home/pi/.node-red/node_modules/node-red-contrib-alexa-home-skill/node_modules/body-parser/node_modules/debug/node_modules
2019-06-03T13:21:56.359Z [err] npm
2019-06-03T13:21:56.359Z [err] WARN checkPermissions
2019-06-03T13:21:56.360Z [err] Missing write access to /home/pi/.node-red/node_modules/prompt-radio/node_modules
2019-06-03T13:21:57.629Z [err] npm
2019-06-03T13:21:57.629Z [err] WARN node-red-project@0.0.1 No repository field.
2019-06-03T13:21:57.629Z [err] npm
2019-06-03T13:21:57.630Z [err] WARN node-red-project@0.0.1 No license field.
2019-06-03T13:21:57.632Z [err]
2019-06-03T13:21:57.643Z [err] npm
2019-06-03T13:21:57.644Z [err] ERR! path /home/pi/.node-red/node_modules/@serialport/bindings/node_modules/@serialport/parser-delimiter
2019-06-03T13:21:57.644Z [err] npm ERR! code
2019-06-03T13:21:57.645Z [err] EACCES
2019-06-03T13:21:57.646Z [err] npm
2019-06-03T13:21:57.647Z [err] ERR! errno -13
2019-06-03T13:21:57.647Z [err] npm ERR!
2019-06-03T13:21:57.648Z [err] syscall access
2019-06-03T13:21:57.653Z [err] npm
2019-06-03T13:21:57.653Z [err] ERR! Error: EACCES: permission denied, access '/home/pi/.node-red/node_modules/@serialport/bindings/node_modules/@serialport/parser-delimiter'
2019-06-03T13:21:57.653Z [err] npm
2019-06-03T13:21:57.653Z [err] ERR! { [Error: EACCES: permission denied, access '/home/pi/.node-red/node_modules/@serialport/bindings/node_modules/@serialport/parser-delimiter']
2019-06-03T13:21:57.653Z [err] npm
2019-06-03T13:21:57.654Z [err] ERR! stack:
2019-06-03T13:21:57.654Z [err] npm ERR!
2019-06-03T13:21:57.654Z [err] 'Error: EACCES: permission denied, access '/home/pi/.node-red/node_modules/@serialport/bindings/node_modules/@serialport/parser-delimiter'',
2019-06-03T13:21:57.654Z [err] npm
2019-06-03T13:21:57.655Z [err] ERR! errno: -13,
2019-06-03T13:21:57.655Z [err] npm
2019-06-03T13:21:57.655Z [err] ERR! code: 'EACCES',
2019-06-03T13:21:57.655Z [err] npm ERR!
2019-06-03T13:21:57.655Z [err] syscall: 'access',
2019-06-03T13:21:57.655Z [err] npm
2019-06-03T13:21:57.656Z [err] ERR!
2019-06-03T13:21:57.656Z [err] path:
2019-06-03T13:21:57.656Z [err] npm
2019-06-03T13:21:57.656Z [err] ERR! '/home/pi/.node-red/node_modules/@serialport/bindings/node_modules/@serialport/parser-delimiter' }
2019-06-03T13:21:57.657Z [err] npm
2019-06-03T13:21:57.658Z [err] ERR!
2019-06-03T13:21:57.658Z [err] npm
2019-06-03T13:21:57.658Z [err] ERR!
2019-06-03T13:21:57.658Z [err] The operation was rejected by your operating system.
2019-06-03T13:21:57.658Z [err] npm ERR!
2019-06-03T13:21:57.658Z [err] It is likely you do not have the permissions to access this file as the current user
2019-06-03T13:21:57.658Z [err] npm
2019-06-03T13:21:57.659Z [err] ERR!
2019-06-03T13:21:57.659Z [err] npm ERR!
2019-06-03T13:21:57.659Z [err] If you believe this might be a permissions issue, please double-check the
2019-06-03T13:21:57.659Z [err] npm
2019-06-03T13:21:57.659Z [err] ERR!
2019-06-03T13:21:57.660Z [err] permissions of the file and its containing directories, or try running
2019-06-03T13:21:57.660Z [err] npm ERR!
2019-06-03T13:21:57.660Z [err] the command again as root/Administrator (though this is not recommended).
2019-06-03T13:21:57.738Z [err]
2019-06-03T13:21:57.739Z [err] npm ERR! A complete log of this run can be found in:
2019-06-03T13:21:57.739Z [err] npm ERR! /home/pi/.npm/_logs/2019-06-03T13_21_57_698Z-debug.log
2019-06-03T13:21:57.775Z rc=243

At this point, if you haven't got anythnig else on the Pi, I'd be tempted to just reflash the SD card and start a fresh. I'd use the script (https://nodered.org/docs/hardware/raspberrypi) to install NR and then I'd write a bash script to install all the nodes you need - note, you will need to know the fulll names to do this. Something like:

#!/bin/bash
 
cd /home/pi/.node-red
npm -s install node-red-contrib-dht-sensor
npm -s install node-red-node-openweathermap 
npm -s install node-red-dashboard
npm -s install node-red-node-base64
npm -s install node-red-node-sqlite

anyways, that's what I would do