Node-RED crashing... system time change detected, entities not found in cache

I’m not sure what you mean here; node-red-contrib-time-range-switch is installed by default and should already appear in your palette? And I’m not sure which logs you mean; it looks like all the “System Time Change Detected” are from cronplus nodes.

Digging deeper, it looks like cronplus is measuring how long it is taking between 1-second interval checks and finding that sometimes it is taking 5 seconds or more. This probably means you have a lot of processing happening in other nodes between checks, and may or may not be a real problem. You can change the threshold to reduce the log noise if this should be considered normal by adding the following to your Node-RED settings.js file (in the /addon_configs/*_nodered or /addon_configs/*_node-red-plus directory depending which app you are running):

    …
    CRONPLUS_MAX_CLOCK_DIFF: 10000,  /* milliseconds */
    …

The above would change the threshold to 10 seconds before logging the “System Time Change Detected” message.

When I opened my flows in NR Plus, none of the Time Range Switch nodes were a recognized type. And I couldn’t find that node type in the palette (maybe there’s a reason it’s not in NR Plus?).

Yes, they are… got my wires crossed because it was those two node types that didn’t load correctly in NR Plus.
For the cronplus nodes, I don’t like having to work around the default duration for that node handshake… but I’ll keep watching it with that option in mind.

I confirmed my VMM NTP settings on the Synology… everything looks normal.

Hmm, that would be interesting to investigate further. It is definitely installed by default so I wonder if it could have been another node type or if there was some other conflict or reason the nodes weren’t recognized. I’m happy to follow up if you would like to share a screenshot or other logs showing the problem.

It’s a relatively light lift to get the flows into NR Plus… but it may be a bit before I get to try it again.

I tried to post all of my flows below in case anything jumps out at anyone… but the site gives me an “internal server error.” Maybe it’s too much text for a code block…?

Nothing else appears in the logs. I fixed one bad function this morning, but it didn’t make a noticeable improvement.

EDIT: Here’s an export of one of my cronplus nodes, in case there’s an issue with them. I have five of them in all of my flows; all five appear in the logs:

[{"id":"53b11ea3c37ccd8f","type":"cronplus","z":"b199f89f.aefe08","g":"001169fa4735facd","name":"Weekday & Weekend PM","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"","defaultLocationType":"default","outputs":1,"options":[{"name":"Weekend","topic":"weekend","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 ? * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":190,"y":1700,"wires":[["e40ec2aa1dbd555a"]]},{"id":"0a79a70b9570709e","type":"global-config","env":[],"modules":{"node-red-contrib-cron-plus":"2.2.4"}}]

EDIT: I guess I could also replace all of my cronplus nodes with inject enhanced nodes (used elsewhere in my flows & don’t throw log entries)… but that might just be masking the issue.

FYI I didn’t have any trouble migrating that flow from the community NR app to Node-RED Plus. I had installed node-red-contrib-cron-plus through the Node-RED palette manager though rather than in the app configuration. If you did the latter and didn’t duplicate the config in Node-RED Plus, maybe that could explain why the node was unrecognized?

That’s probably it… I’ll try that next time. I really didn’t look in the default palette to see if that node was already in there… just in the user-installed nodes.

I ran into some issues with my host and had to re-install HA from scratch and restore from a backup.

This is why I originally set up my VM with 2GB RAM allocated:

When creating the virtual machine, assign memory and CPU resources based on your expected workload. You can increase these resources later if your workload grows.
Minimum resources:

  • Memory: 2 GB of RAM
  • Processors: 2 vCPUs

I don’t know if that’s a valid minimum any longer.

It probably is still a valid minimum, for a VM, that runs nothing other than Home Assistant. As I believe the current position, HA supervised consumes about 1.5GB, so that leaves around 0.5GB for everything else. With nothing else, yes 1.5 fits inside 2.0.

As soon as you start adding Apps, that minimum moves on upwards to 3GB, and for an intensive HA with several Apps, probably closer to 4GB today.

I run HA on a ‘Blue’ with 4GB, and I have a very light system with really just Node-RED as an App, also running very little. My current total memory use is around 1.8GB. That leaves very little headroom.

The real figures (using Glances) shows homeassistant using 1.47GB [so 1.5 is probably about right today] and Node-RED (App) 0.24GB [NR does not actually use very much memory, unless you have a lot of flows creating big arrays of complex objects].

However, adding up all the additional hassio_ bits and pieces gives a total memory in use of 1.9GB, so there goes the 2GB.

More useful is to look at the memory caching figures -

Total: 3.7 GB
Used: 1.9 GB
Active: 2.1 GB
Inactive 1.0 GB
Cached: 1.6 GB

I’m no expert on what this fully means, but my assumption is that 1.9GB is being used now out of the physical 3.7GB, and without caching that would be 2.1GB reserved for use (or 2.9GB total including the inactive stuff). With caching out the inactive, the 1.9 just about fits into 2.0GB, with not much having to be moved in and out of cache. Using more memory, with a busy machine, more and more has to be regularly cached and de-cached to get 2.1GB or more in use to fit into 2.0GB.

Eventually the caching starts thrashing, and performance plummets. At that point, Node-RED does not get enough time to run the garbage collection, and with increasing need to do garbage collection to recover the little memory available, the end comes with a rapid full stop.

Yes you can run Home Assistant on 2GB, and yes you can run Node-RED as an App with it. You just can’t run lots of other stuff and video processing and lots of complex NR flows, and as the docs say “You can increase these resources later if your workload grows”. Maybe it should say “You MUST increase these resources…”?

I’ve made significant progress by just deleting some old unused containers from my NAS. I’ve also got an unsanctioned (by Synology) 16GB DDR4 stick to try out (currently running 4+4).

EDIT: 5-minute swap. Now I’m at 20GB, well in excess of what I need… but if I’m honest, hardware wasn’t my issue to begin with.