unknown problem with node-red

538 views
Skip to first unread message

Claudio Francesconi

unread,
Nov 16, 2017, 11:05:52 AM11/16/17
to Node-RED
hi guys i have a terrible problem i wonder if you can help

i am running node-red which is handled by this service:
# 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 - feel free to change...
User=pi
Group=pi
WorkingDirectory=/home/pi
Nice=5
Environment="NODE_OPTIONS=--max-old-space-size=128"
# 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"
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target
it used to work like charm
today nothing is working

if i check the status it says this:
● nodered.service - Node-RED graphical event wiring tool.
   Loaded: loaded (/lib/systemd/system/nodered.service; enabled)
   Active: failed (Result: start-limit) since gio 2017-11-16 16:51:53 CET; 3min 51s ago
     Docs: http://nodered.org/docs/hardware/raspberrypi.html
  Process: 16795 ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS (code=exited, status=9)
 Main PID: 16795 (code=exited, status=9)

nov 16 16:51:53 pitre systemd[1]: Unit nodered.service entered failed state.
nov 16 16:51:53 pitre systemd[1]: nodered.service holdoff time over, scheduling restart.
nov 16 16:51:53 pitre systemd[1]: Stopping Node-RED graphical event wiring tool....
nov 16 16:51:53 pitre systemd[1]: Starting Node-RED graphical event wiring tool....
nov 16 16:51:53 pitre systemd[1]: nodered.service start request repeated too quickly, refusing to start.
nov 16 16:51:53 pitre systemd[1]: Failed to start Node-RED graphical event wiring tool..
nov 16 16:51:53 pitre systemd[1]: Unit nodered.service entered failed state.

but if i run manually /usr/bin/node-red-pi 
it seems to work good

any help?
thanks

Claudio Francesconi

unread,
Nov 16, 2017, 11:26:24 AM11/16/17
to Node-RED
btw
if i make node-red-start
i have this:

Once Node-RED has started, point a browser at http://192.168.1.3: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.

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..

node: --max-old-space-size=128 is not allowed in NODE_OPTIONS

nodered.service: main process exited, code=exited, status=9/n/a

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..

node: --max-old-space-size=128 is not allowed in NODE_OPTIONS

nodered.service: main process exited, code=exited, status=9/n/a

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..

node: --max-old-space-size=128 is not allowed in NODE_OPTIONS

nodered.service: main process exited, code=exited, status=9/n/a

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..

node: --max-old-space-size=128 is not allowed in NODE_OPTIONS

nodered.service: main process exited, code=exited, status=9/n/a

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....

nodered.service start request repeated too quickly, refusing to start.

Failed to start Node-RED graphical event wiring tool..

Unit nodered.service entered failed state.
 

Mark Setrem

unread,
Nov 16, 2017, 12:21:05 PM11/16/17
to Node-RED
what version of node-red and node.js?

there was an issue the other day which might be related
https://groups.google.com/forum/m/#!topic/node-red/1oDHOVtLuRo

but that appeared to only be and issue with other types of autostartscript rather than the recommended script. So if this is on a raspberry pi it might be worth using the update script (see the docs) and then replacing your auto start script with the supported one and trying again.

Julian Knight

unread,
Nov 16, 2017, 12:42:34 PM11/16/17
to Node-RED
Change the line

Environment="NODE_OPTIONS=--max-old-space-size=128"

to

Environment="NODE_OPTIONS=--max_old_space_size=128"

that should work (e.g. dash changes to underscore). A bug in Node v8.

Claudio Francesconi

unread,
Nov 16, 2017, 2:22:45 PM11/16/17
to Node-RED
hey
thank you very much
actually i deleted that line and node-red works again
now i have 2 questions:

-1 what's this instruction for?
-2 why it worked good until yesterday and now its crashing?

thanks

Nick O'Leary

unread,
Nov 16, 2017, 2:35:19 PM11/16/17
to node...@googlegroups.com

Did you update to node 6.12 yesterday?

As of node 6.12, the NODE_OPTIONS environment variable can be used to set runtime arguments of the node process.

By unlucky coincidence, we used the name NODE_OPTIONS for the environment variable that the service script uses to build the command the service runs.

So as of 6.12, if any invalid options are specified in NODE_OPTIONS, the node process will complain where it didn't before.

When they originally added support for this environment variable in node 8.x, they also added a fix to allow parameter names specified in the env var to use either - or _. When they backported support for the env variable to 6.12 they did not include the fix for -/_. Which means max-old-space-size is rejected but the version with _ in is accepted. The -/_ fix is now a candidate for backporting as well, so hopefully 6.13 will fix that bit.

That's probably far more detail than you wanted to know, but there you are!

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/73bc256a-eaae-42d3-a631-1f58f895b841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Claudio Francesconi

unread,
Nov 16, 2017, 2:39:09 PM11/16/17
to Node-RED
i see
6.12 you mean node.js i guess
well i bet raspi did update it when i did apt-get upgrade
best regards
Reply all
Reply to author
Forward
0 new messages