node-red-contrib-cron-plus icon indicating copy to clipboard operation
node-red-contrib-cron-plus copied to clipboard

Dynamic Schedule not persisted in context

Open carefulcomputer opened this issue 1 year ago • 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.

carefulcomputer avatar Jan 07 '24 06:01 carefulcomputer

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

Steve-Mcl avatar Jan 08 '24 16:01 Steve-Mcl

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

carefulcomputer avatar Jan 09 '24 02:01 carefulcomputer

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

carefulcomputer avatar Jan 09 '24 02:01 carefulcomputer

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?

Steve-Mcl avatar Jan 13 '24 00:01 Steve-Mcl

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

carefulcomputer avatar Jan 14 '24 06:01 carefulcomputer

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)

Steve-Mcl avatar Jan 14 '24 08:01 Steve-Mcl

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.

carefulcomputer avatar Jan 21 '24 06:01 carefulcomputer

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

carefulcomputer avatar Mar 12 '24 14:03 carefulcomputer