Steve-Mcl/node-red-contrib-cron-plus

Dynamic Schedule not persisted in context

Opened this issue · 8 comments

Setup:
cron plus v 2.1.0
nodejs 18
node-red 3.1.3

I setup up dynamic schedule which shows up fine in dynamic section of node. Also selected 'save state: node context (default)'.

Issue: However the dynamic schedule is lost after a restart.
Expected result : dynamic schedule is persisted after restart.

If I can provide any additional information to help debug, please let me know.

If I can provide any additional information to help debug, please let me know.

I assume you have set default context to localfilesystem?

Please show me the settings you have in settings.js file under the key contextStorage

 contextStorage: {
        default: {
            module:"localfilesystem"
        },
    },

i am running node-red in docker in case that is relevent.

i am running node-red in docker in case that is relevent.

Possibly. Do you have a bound data directory? Do your flows persist a container restart?

yes to both. my other custom function nodes are able to persist node context without any issues.

Hmmmm. Odd.

Is there anything in the node-red logs?

Is the schedule(s) entered statically or 100% dynamically created/controlled?

Could select and the problematic Cron node and past into a reply? Additionally, could you capture the full msg object of 1 or 2 dynamic messages that your flows generate (the ones that add/remove/pause a dynamic schedule)

Do you have a non docker based node-red installation? If yes, could export your flows to that and and see if it works on a regular install? (Don't forget the settings.js entry)

i did some more checks. looks like it is not just this node, for some reason my other nodes are losing the context too. trying to figure out what is wrong.

Some more info. I found following in my logs when schedule was not persisted

2024-03-11T15:14:07.767444714Z 11 Mar 08:14:07 - [info] [cronplus:3d5c29391a1509fa] System Time Change Detected - refreshing schedules! If the system time was not changed then this typically occurs due to blocking code elsewhere in your application