Trouble init flow (OrangePi)

Hi, i have using node inject as init flow. But i have a trouble.

When i unplugged my wire ethernet and after plugged, my node flow restarted...

How I can avoid this? and make it start only when my node red boots

What do the Node-RED logs show?

Did Node-RED restart for some reasons when you pulled the network cable? That's the only reason the Inject node would be triggered again.

Where i can see log?

It depends on how you installed Node-RED, and how you run it. If you can describe how you set it up, we can point you at the logs.

Im using ubuntu one device OrangePi R1+

https://nodered.org/docs/getting-started/raspberrypi

You're going to have to work this out yourself as I can't dig through your logs.

As I said, the only reason an Inject node would fire on start is if Node-RED has restarted. So you need to look at the logs whilst pulling the network cable. (use node-red-log to stream the logs - assuming you used the pi install script you linked to) to see what Node-RED does.

I found the log share my capture

  at afterDns (node:dgram:659:5)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:03:47 - [info]
Welcome to Node-RED
===================
27 Jan 13:03:47 - [info] Node-RED version: v3.0.2
27 Jan 13:03:47 - [info] Node.js  version: v16.19.0
27 Jan 13:03:47 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:03:51 - [info] Loading palette nodes
27 Jan 13:03:57 - [info] Settings file  : /root/.node-red/settings.js
27 Jan 13:03:57 - [info] Context store  : 'default' [module=memory]
27 Jan 13:03:57 - [info] User directory : /root/.node-red
27 Jan 13:03:58 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:03:58 - [error] Uncaught Exception:
27 Jan 13:03:58 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
    at Server.setupListenHandle [as _listen2] (node:net:1463:16)
    at listenInCluster (node:net:1511:12)
    at doListen (node:net:1660:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 4.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:04:22 - [info]
Welcome to Node-RED
===================
27 Jan 13:04:22 - [info] Node-RED version: v3.0.2
27 Jan 13:04:22 - [info] Node.js  version: v16.19.0
27 Jan 13:04:22 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:04:26 - [info] Loading palette nodes
27 Jan 13:04:33 - [info] Settings file  : /root/.node-red/settings.js
27 Jan 13:04:33 - [info] Context store  : 'default' [module=memory]
27 Jan 13:04:33 - [info] User directory : /root/.node-red
27 Jan 13:04:33 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:04:33 - [error] Uncaught Exception:
27 Jan 13:04:33 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
    at Server.setupListenHandle [as _listen2] (node:net:1463:16)
    at listenInCluster (node:net:1511:12)
    at doListen (node:net:1660:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 5.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:04:58 - [info]
Welcome to Node-RED
===================
27 Jan 13:04:58 - [info] Node-RED version: v3.0.2
27 Jan 13:04:58 - [info] Node.js  version: v16.19.0
27 Jan 13:04:58 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:05:02 - [info] Loading palette nodes
27 Jan 13:05:09 - [info] Settings file  : /root/.node-red/settings.js
27 Jan 13:05:09 - [info] Context store  : 'default' [module=memory]
27 Jan 13:05:09 - [info] User directory : /root/.node-red
27 Jan 13:05:09 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:05:09 - [info] Server now running at http://127.0.0.1:1880/
27 Jan 13:05:10 - [info] Active project : ContadoresCom3010
27 Jan 13:05:10 - [info] Flows file     : /root/.node-red/projects/ContadoresCom3010/flows.json
27 Jan 13:05:10 - [warn] Using unencrypted credentials
27 Jan 13:05:10 - [info] Starting flows
27 Jan 13:05:10 - [info] Started flows
27 Jan 13:05:12 - [red] Uncaught Exception:
27 Jan 13:05:12 - [error] Error: send ENETUNREACH 255.255.255.255:44818
    at doSend (node:dgram:713:16)
    at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
    at afterDns (node:dgram:659:5)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

That just shows lots of attempts to run Node-RED when it was already running. Again, I don't know how any of that log relates to when you pulled out the network cable.

In another post I read that the problem is:

I'm not very good at this to solve it

[error] Error: send ENETUNREACH 255.255.255.255:44818

Having a single line like that without any context makes it hard to suggest what is wrong.

What other post did you read to find that?

My guess is a node you have does not like having the network pulled out and is crashing Node-RED. Node-RED then restarts and retriggers your Inject node.

So the question is what node is causing the crash.... that isn't something we can tell you without a more complete log output from the error.

I opened an empty project and it keeps throwing that error, now I'm going to reinstall my system in case something is misconfigured

I found the problem and how do I fix it!

It turns out that I am using an orange Pi device but I installed node-red using the following link because it has debian opartive system.

Running on Raspberry Pi : Node-RED (nodered.org)

Any method of installing using those link, they broke node-red on my operating system.

The solution is the next:

Step 1:Install node-red using:

npm install -g --unsafe-perm node-red

Step2 then pm2 should be installed

sudo npm install -g pm2

pm2 start /usr/bin/node-red --node-args="--max-old-space-size=128" -- -v

pm2 save

pm2 startup

pm2 startup systemd

And last step reboot system

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