Warning in systemd / journalctl: referenced but unset environment

Hi, I saw in journalctl the following warning message

nodered.service: Referenced but unset environment variable evaluates to an empty string: NODE_RED_OPTIONS

in both of my Ubuntu VM.

Can you tell me what is the problem / how to solve ?

greetings

Copy/paste your systemd nodered script here please. Copy/paste, not a screenshot. If you installed using the recommended script for Ubuntu that will be /lib/systemd/system/nodered.service

[Edit] I have moved this post to the general category as it is not about the core node-red development.

1 Like
# systemd service file to start Node-RED

[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=pi
Group=pi
WorkingDirectory=/home/pi

Environment="NODE_OPTIONS=--max_old_space_size=1024"
# define an optional environment file in Node-RED's user directory to set custom variables externally
EnvironmentFile=-/home/pi/.node-red/EnvironmentFile
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
# uncomment next line if you need to wait for time sync before starting
#ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "systemd-timesyncd.* Synchronized to time server"'

ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
RestartSec=20
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target

other VM:

# systemd service file to start Node-RED

[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=pi
Group=pi
WorkingDirectory=/home/pi

Environment="NODE_OPTIONS=--max_old_space_size=2048"
# define an optional environment file in Node-RED's user directory to set custom variables externally
EnvironmentFile=-/home/pi/.node-red/EnvironmentFile
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
# uncomment next line if you need to wait for time sync before starting
#ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "systemd-timesyncd.* Synchronized to time server"'

ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
RestartSec=20
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target

As you can see, NODE_RED_OPTIONS is, by default, not set, so the warning is correct. The variable is normally not set so the only question is why is it showing a warning for you when, for me at least, the warning is not displayed. Perhaps your systemd is a later version, or perhaps somehow the log level for systemd is higher. Whatever the cause of it showing the warning line it is nothing to worry about, so you can safely ignore it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.