# Warning in systemd / journalctl: referenced but unset environment

**URL:** <https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190>\
**Category:** General\
**Created:** [22 September 2024 21:01 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190 "2024-09-22T21:01:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [22 September 2024 21:01 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190/1 "2024-09-22T21:01:24Z")

</div>

Hi, I saw in journalctl the following warning message

```auto
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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 September 2024 08:51 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190/2 "2024-09-23T08:51:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [23 September 2024 16:22 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190/3 "2024-09-23T16:22:33Z")

</div>

```auto
# 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:

```auto
# 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

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 September 2024 19:50 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190/4 "2024-09-23T19:50:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 October 2024 19:51 UTC](https://discourse.nodered.org/t/warning-in-systemd-journalctl-referenced-but-unset-environment/91190/5 "2024-10-07T19:51:13Z")

</div>

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