jensrossbach / node-red-contrib-chronos

Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
https://jensrossbach.github.io/node-red-contrib-chronos
MIT License
28 stars 1 forks source link

Error on sending "reload" to Scheduler node #106

Closed Alloc86 closed 1 year ago

Alloc86 commented 1 year ago

Describe the bug I have a simple scheduler node to calculate sunrise time. As I only need the time of the event and not the event I enabled the output for event times. I use an inject node that runs once after midnight (for testing I trigger it manually) that sends the "reload" payload. At the beginning this worked fine, it always sent the times of the events to the second output whenever the inject node was triggered.

At some point without changing either the inject or scheduler nodes it started giving me the following error in Node Red's debug output: "TypeError: Cannot read property 'fill' of undefined"

When I change the inject to send any other payload (like "xreloadx") it changes part of the error to "property '0'".

To reproduce Not sure if this will easily repro as it did not do that at the beginning for me either, but this is my node setup: [{"id":"fd3f6351841f50af","type":"chronos-scheduler","z":"3dc61cf8.34fed4","name":"Morgendämmerung","config":"408f1a63ad75f841","schedule":[{"trigger":{"type":"sun","value":"dawn","offset":0,"random":false},"output":{"type":"msg","property":{"name":"payload","type":"str","value":"X"}}}],"multiPort":false,"nextEventPort":true,"disabled":false,"outputs":2,"x":430,"y":1080,"wires":[[],["6a425eb870331ab8"]]},{"id":"2e0b8a6b361a321b","type":"inject","z":"3dc61cf8.34fed4","name":"Daily","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"reload","payloadType":"str","x":210,"y":1120,"wires":[["fd3f6351841f50af"]]},{"id":"6a425eb870331ab8","type":"debug","z":"3dc61cf8.34fed4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":1100,"wires":[]},{"id":"408f1a63ad75f841","type":"chronos-config","name":"Niersteiner","timezone":"","sunPositions":[]}] Actually even copy pasting this exact setup in my own environment works fine right now, while the source of the copy shows the error.

Expected behavior Have the "reload" trigger not make it throw errors and instead output a message from the scheduler node with the event values.

Screenshots nodered-chronos-error

Context information Please complete the following information.

Additional information I am available for having a look at my environment if that helps (e.g. with TeamViewer).

jensrossbach commented 1 year ago

Do I understand correctly that even redeploying the flow does not solve the error? Can you maybe post the complete logs at debug level?

Alloc86 commented 1 year ago

I did not redeploy the flow, only the node (by changing the payload that the node outputs on the event, though that's not used anyway as I do not use the regular output) and other nodes on the same flow.

I just restarted NodeRed with logging set to debug, but of course the error does not occur right now. I will keep an eye on that and will post if/when I am able to reproduce it again.

Also noticed that for my task the time switch node is better suited with some proper use of JSONata :)

Alloc86 commented 1 year ago

Of course I can not repro it anymore since the restart. I will consider this a random rare error that might just as well be something specific on my end :)

Thanks for the nice node!