Howdy, I am in the process of bringing up several node-red instances on an ubuntu 22.04 server and have had some hard fought successes but I have run into a problem that I cannot seem to find any clues on where to go next.
I will start with some basic information:
- I am running as a standard user but have added sudo power along the way to my user "beetred"
- I am starting all instances of node-red as this user
- my version of npm is 9.2.0, node is v18.13.0 (Thanks to TotallyInformation below)
- my startup script for one of the instances (node-orange) is as follows:
[Unit]
Description=Node-ORANGE
After=network.target
[Service]
Type=simple
ExecStart=/home/beetred/node-orange/node_modules/node-red/bin/node-orange --settings'/home/beetred/node-orange/.data/settings.js'
Restart=on-failure
KillSignal=SIGINT
# non-root user to run as
WorkingDirectory=/home/beetred/node-orange/.data
User=beetred
Group=beetred
[Install]
WantedBy=multi-user.target
and the results of the boot are good:
â—Ź node-orange.service - Node-ORANGE
Loaded: loaded (/etc/systemd/system/node-orange.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2023-01-29 12:23:40 MST; 56min ago
Main PID: 5245 (node-red)
Tasks: 11 (limit: 28471)
Memory: 54.3M
CPU: 2.091s
CGroup: /system.slice/node-orange.service
└─5245 node-red "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
Jan 29 12:23:40 plex node-orange[5245]: You should set your own key using the 'credentialSecret' option in
Jan 29 12:23:40 plex node-orange[5245]: your settings file. Node-RED will then re-encrypt your credentials
Jan 29 12:23:40 plex node-orange[5245]: file using your chosen key the next time you deploy a change.
Jan 29 12:23:40 plex node-orange[5245]: ---------------------------------------------------------------------
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [warn] Encrypted credentials not found
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [info] Server now running at http://127.0.0.1:1893/
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [info] Starting flows
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [debug] red/nodes/flows.start : starting flow : global
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [debug] red/nodes/flows.start : starting flow : 69e6e59182af629b
Jan 29 12:23:40 plex node-orange[5245]: 29 Jan 12:23:40 - [info] Started flows
But when I go into the web page there is no manage palette option.
if I do a which npm at the command line as a beetred user I get:
$ which npm
/home/beetred/.nvm/versions/node/v18.13.0/bin/npm
which seems good to me
my settings file is as follows (with all comments removed for brevity)
module.exports = {
flowFile: '/home/beetred/node-orange/.data/flows.json',
flowFilePretty: true,
userDir: '/home/beetred/node-orange/.data',
uiPort: process.env.PORT || 1893,
diagnostics: {
enabled: true,
ui: true,
},
runtimeState: {
enabled: false,
ui: false,
},
logging: {
console: {
level: "debug",
metrics: false,
audit: false
}
},
exportGlobalContextKeys: false,
externalModules: {
},
editorTheme: {
page: {title: "Node-ORANGE"},
header:{title: "Node-ORANGE"},
palette: {
},
projects: {
enabled: false,
workflow: {
mode: "manual"
}
},
codeEditor: {
lib: "monaco",
options: {
}
}
},
functionExternalModules: true,
functionGlobalContext: {
},
debugMaxLength: 1000,
mqttReconnectTime: 15000,
serialReconnectTime: 15000,
}
and my exec file for node-red is the same as the node-red-pi file
OPTIONS=""
ARGS=""
for arg in "$@"
do
case $arg in
--userDir|--settings|--help) ARGS="$ARGS $arg";;
--*) OPTIONS="$OPTIONS $arg";;
*) ARGS="$ARGS $arg";;
esac
done
# Find the real location of this script
CURRENT_PATH=$(pwd)
SCRIPT_PATH=$(readlink -f "$0")
while [ -h "${SCRIPT_PATH}" ]; do
cd "$(dirname "${SCRIPT_PATH}")" || exit 1
P=$(basename "${SCRIPT_PATH}")
SCRIPT_PATH=$(readlink "${P}")
done
cd "$(dirname "${SCRIPT_PATH}")" > /dev/null || exit 1
SCRIPT_PATH=$(pwd)
cd "$CURRENT_PATH" || exit 1
# Run Node-RED
exec /home/beetred/.nvm/versions/node/v18.13.0/bin/node ${OPTIONS} ${SCRIPT_PATH}/../red.js ${ARGS}
and my PATH for the beetred user is:
/home/beetred/.nvm/versions/node/v18.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/games:/usr/local/games:/snap/bin
Any ideas on where I should look or what I should try next would be very much appreciated. Right now I am at a point I can't think of anything else to try.