Node red restart by itself

Hello,
I am using nodered on a raspberry 4b, in a docker container using IOTStack configuration.

I use nodered mainly to get data from OPC UA and inject them in influxDB but also for interface with OpenWeather or Shelly equipment using MQTT and HTTP requests

Recently I added the telegram interface in order to send message to my iPhone.

I create a very simple telegram message generated at each nodered restart .

And I noticed that nodered is restarting by himself sometimes.
How can I find the reason of the nodered restart . There must be a log somewhere.
Is there a way to read this log file from nodered at the restart time and send the content by mail or by telegram ?

Remark :
I am using two nodered containers: an old one running nodered 1.2.6 and a new one running 3.0.2.

My plan is to migrate all flow from the old to the new, flow by flow, deploying, testing the updated flow one by one.

For now only the old nodered generate the auto restart.
On the new I already implement some of the old flow but not all of them.

Thanks for any help

If it is running in docker you can do:

// docker logs --since=<timeframe> container-name
// or 
// docker logs --tail <number of lines> container-name

eg.

docker logs --since=8h nodered
docker logs --tail 1000 nodered
1 Like

Thanks, are there similar commands that I can run directly inside the container from one exec node?

Hello,
the command
docker logs -- until (timestamp of the nodered restart) nodered
did not give any result.
I tried a simple
docker logs --tail 50 nodered
this gave me the same opc ua error repeating but i cannot find any timestamp, how can i know when this error is occuring and really troubleshoot the problem...

cannot find private stuff for Application.Echange
Error
    at EXTENSION.get schema [as schema] (/data/node_modules/node-opcua-schemas/dist/source/dynamic_extension_object.js:326:25)
    at EXTENSION.toString (/data/node_modules/node-opcua-factory/dist/factories_baseobject.js:376:18)
    at EXTENSION.toString (/data/node_modules/node-opcua-schemas/dist/source/dynamic_extension_object.js:564:26)
    at Object.encodeObject (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:804:45)
    at sendDebug (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:197:24)
    at /usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:174:29
    at prepareValue (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:70:17)
    at DebugNode._inputCallback (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:157:17)
    at hooks.trigger (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)
    at DebugNode.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)
    at DebugNode.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)
    at DebugNode.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)
    at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
cannot find private stuff for Application.Echange
Error
    at EXTENSION.get schema [as schema] (/data/node_modules/node-opcua-schemas/dist/source/dynamic_extension_object.js:326:25)
    at EXTENSION.toString (/data/node_modules/node-opcua-factory/dist/factories_baseobject.js:376:18)
    at EXTENSION.toString (/data/node_modules/node-opcua-schemas/dist/source/dynamic_extension_object.js:564:26)
    at Object.encodeObject (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:804:45)
    at sendDebug (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:197:24)
    at /usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:174:29
    at prepareValue (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:70:17)
    at DebugNode._inputCallback (/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js:157:17)
    at hooks.trigger (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:203:26)
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/runtime/lib/hooks.js:113:9)
    at DebugNode.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:195:11)
    at DebugNode.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:25)
    at DebugNode.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:476:10)
    at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:657:52)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

Thanks gor any help on understanding which node is creating the problem.

(Just in passing)

I had a lot of problems a while back now. Machine would do weird things and MQTT messages get sent at the wrong times, and all sorts of strange things.

Turned out to be POWER SUPPLY problems.

I would suggest trying another (bigger) one just to rule it out.

I was really annoyed after months of that kind of problem and my stubbornness to accept/believe it was that.