I am trying to learn how to implement sequences that are triggered by a startup event. As a starting point, i copied the sequence from https://cookbook.nodered.org/basic/trigger-on-start and embellished it by writing the payload to a file and by sending the payload to my phone via the super useful twilio node.
Much to my surprise, i have started receiving startup event texts when they are not expected (i.e. when I am at work, at 04:00 in the morning, and other times when I am not doing any node-red work and am not logged into the machine that hosts node-red.).
The startup page referenced above says:
Discussion
When configured to fire on start, the Inject
node will be automatically triggered a few hundred milliseconds after it is deployed. This delay is used to help ensure the rest of the flows have been created and Started by this point.
The node will trigger whenever it is deployed.
Because I am receiving startup texts at 4 in the morning, I would like to know what else besides deploying the trigger node causes a startup event.
If the machine hosting Node-RED has a momentary disconnect from the network, will that cause Node-RED to trigger a start event?
My experience shows me that it is more than starting the node-red service that will trigger a startup event.
This is what I am trying to learn: what are the scenarios will cause this sequence to be triggered? https://cookbook.nodered.org/basic/trigger-on-start
Thanks for your help with this.
Re content from the log, i grabbed log content before and after what I have posted above. (sorry, don't know why the bold text)
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x2afcf2d4fb5d]
Security context: 0x3bddea79d9f1 <JSObject>
1: _clone(aka _clone) [0x32acb8458439] [/usr/lib/node_modules/node-red/node_modules/clone/clone.js:~73] [pc=0x2afcf3311404](this=0x115e51d825b1 <undefined>,0x0f2cb3bb8c31 <String[14]: 6411219e.ae246>,0x32acb8458669 <HeapNumber inf>)
2: _clone(aka _clone) [0x32acb8458439] [/usr/lib/node_modules/node-red/node_modules/clone/clone.js:~73] [pc=0x2afcf3311...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x944930 node::Abort() [node-red]
2: 0x9457dc node::OnFatalError(char const*, char const*) [node-red]
3: 0xb0d01e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node-red]
4: 0xb0d254 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node-red]
5: 0xf09822 [node-red]
6: 0xf09928 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node-red]
7: 0xf16048 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node-red]
8: 0xf16b5b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
9: 0xf19891 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node-red]
10: 0xee3ac4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node-red]
11: 0x11994ae v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node-red]
12: 0x2afcf2d4fb5d
2019-06-14 01:15:59 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 448, in start
await resp.write_eof()
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 444, in write_eof
await self._payload_writer.write_eof(data)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 138, in write_eof
self._write(chunk)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
node-red.service: Main process exited, code=dumped, status=6/ABRT
2019-06-14 01:15:59 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 448, in start
await resp.write_eof()
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 444, in write_eof
await self._payload_writer.write_eof(data)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 138, in write_eof
self._write(chunk)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
2019-06-14 01:15:59 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 448, in start
await resp.write_eof()
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 444, in write_eof
await self._payload_writer.write_eof(data)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 138, in write_eof
self._write(chunk)
File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 67, in _write
raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
node-red.service: Unit entered failed state.
node-red.service: Failed with result 'core-dump'.
node-red.service: Service hold-off time over, scheduling restart.
Stopped Node-RED.
Started Node-RED.
14 Jun 01:15:59 - [info]
Welcome to Node-RED
===================
14 Jun 01:15:59 - [info] Node-RED version: v0.19.4
14 Jun 01:15:59 - [info] Node.js version: v11.3.0
14 Jun 01:15:59 - [info] Linux 4.4.0-148-generic x64 LE
14 Jun 01:16:00 - [info] Loading palette nodes
14 Jun 01:16:01 - [info] Dashboard version 2.15.4 started at /ui
14 Jun 01:16:01 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
14 Jun 01:16:01 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
14 Jun 01:16:01 - [info] Settings file : /home/homemanadmin/.node-red/settings.js
14 Jun 01:16:01 - [info] Context store : 'default' [module=memory]
14 Jun 01:16:01 - [info] User directory : /home/homemanadmin/.node-red
14 Jun 01:16:01 - [info] Server now running at http://127.0.0.1:1880/
14 Jun 01:16:01 - [info] Active project : nodered-homeassistant
14 Jun 01:16:01 - [info] Flows file : /home/homemanadmin/.node-red/projects/nodered-homeassistant/flows_homeMan-server.json
14 Jun 01:16:01 - [info] Starting flows
14 Jun 01:16:01 - [info] [sun events:Sunevent] Calculating sun event times for 33.5464796, -112.0974539.
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Initialising job to calculate sunevents
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Calculating times for Fri Jun 14 2019 23:59:59 GMT-0700
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting solarNoon Today at 12:29 PM in 11 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Ignoring nadir, was Today at 12:29 AM, 0 hours ago
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting sunrise Today at 5:19 AM in 4 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting sunset Today at 7:40 PM in 18 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting sunriseEnd Today at 5:22 AM in 4 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting sunsetStart Today at 7:37 PM in 18 hours
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=120955 PROTO=UDP SPT=45447 DPT=10001 LEN=155
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting dawn Today at 4:50 AM in 3 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting dusk Today at 8:09 PM in 18 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting nauticalDawn Today at 4:14 AM in 2 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting nauticalDusk Today at 8:45 PM in 19 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting nightEnd Today at 3:35 AM in 2 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting night Today at 9:24 PM in 20 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting goldenHourEnd Today at 5:55 AM in 4 hours
14 Jun 01:16:01 - [info] [sun events:Sunevent] [sunevents] Emitting goldenHour Today at 7:04 PM in 17 hours
14 Jun 01:16:02 - [info] [inject:sms_suspend] crontab = 00 09 * * *
14 Jun 01:16:02 - [info] [inject:8629978f.2e5c3] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:cdadb250.cf2348] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:20597ffd.e53a6] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:9833d03d.f7c92] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:a53d1d8c.95ba98] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:312fa6b6.64206a] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:f30cf6a2.b0d848] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:3989ba37.09d486] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:dd6b70c1.c9cda8] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] [inject:7badfdc3.358384] crontab = 55 23 * * *
14 Jun 01:16:02 - [info] Started flows
14 Jun 01:16:02 - [info] [inject:d8a5c409.704f3] repeat = 10000
14 Jun 01:16:02 - [info] [inject:ping every 10 min] repeat = 600000
14 Jun 01:16:02 - [info] [mqtt-broker:home] Connected to broker: mqtt://192.168.14.178:1883
14 Jun 01:16:02 - [info] [mqtt-broker:home] Connected to broker: water_main_nodered@mqtt://192.168.14.178:1883
14 Jun 01:16:02 - [warn] [api-current-state:suppress text off] local state cache missing, sending empty payload
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=807587 PROTO=UDP SPT=46520 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=776418 PROTO=UDP SPT=43758 DPT=10001 LEN=155
2019-06-14 01:16:58 WARNING (SyncWorker_3) [homeassistant.components.tplink.light] Could not read state for 192.168.14.183: Communication error
pam_unix(cron:session): session opened for user root by (uid=0)
(root) CMD ( cd / && run-parts --report /etc/cron.hourly)
pam_unix(cron:session): session closed for user root
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=388968 PROTO=UDP SPT=40833 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=01:00:5e:00:00:01:c0:56:27:cb:c7:ee:08:00 SRC=192.168.14.97 DST=224.0.0.1 LEN=28 TOS=0x00 PREC=0xC0 TTL=1 ID=54494 PROTO=2
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=524732 PROTO=UDP SPT=33672 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=892283 PROTO=UDP SPT=49931 DPT=10001 LEN=155
2019-06-14 01:18:01 WARNING (SyncWorker_3) [homeassistant.components.tplink.light] Could not read state for 192.168.14.183: Communication error
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=358241 PROTO=UDP SPT=45852 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=194673 PROTO=UDP SPT=59154 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=28236 PROTO=UDP SPT=52161 DPT=10001 LEN=155
[UFW BLOCK] IN=enp0s25 OUT= MAC=33:33:00:00:00:01:b4:fb:e4:82:14:cc:86:dd SRC=fe80:0000:0000:0000:b6fb:e4ff:fe82:14cc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=195 TC=0 HOPLIMIT=1 FLOWLBL=1247 PROTO=UDP SPT=59729 DPT=10001 LEN=155
^C