Expressions page showing old data
-
Hi @toggledbits,
I seem to be having the same issue. Is it possible that the expressions are only saved to the json when a restart of Reactor is done?
Today I looked in Reactor and saw an old version of all my expressions. My latest changes were gone (done a few days ago). Reactor didn't have a restart in the meantime.
When I recreated all new expressions and looked in expression.json, the new expressions weren't there (yet). After I did a restart of Reactor, the changes were visible.
Which moments are the expressions saved to the file?
I'm not running the add-on, but the docker. I do not have the latest update yet (latest-23114-e4060aae)
This doesn't explain why my changes were gone, but I'm still tinkering about that. Maybe my backup messes something up.
-
Hi @toggledbits,
I seem to be having the same issue. Is it possible that the expressions are only saved to the json when a restart of Reactor is done?
Today I looked in Reactor and saw an old version of all my expressions. My latest changes were gone (done a few days ago). Reactor didn't have a restart in the meantime.
When I recreated all new expressions and looked in expression.json, the new expressions weren't there (yet). After I did a restart of Reactor, the changes were visible.
Which moments are the expressions saved to the file?
I'm not running the add-on, but the docker. I do not have the latest update yet (latest-23114-e4060aae)
This doesn't explain why my changes were gone, but I'm still tinkering about that. Maybe my backup messes something up.
@RHCPNG said in Home Assistant add-on:
I'm not running the add-on, but the docker.
Well, then you're posting in the wrong thread. This thread is for the add-on (only). I'll move the post, but in future, please consider the relevance of your question to the subject (i.e. title) of the thread, not something any part of contents may mention in its progress. Check the posting guidelines as well.
Always refresh your browser when things look "old" as a first step, rather than restarting Reactor. In particular, if the changes were made in a different browser, it's quite possible the "other" browser would continue to show out of date expressions.
-
Sorry for posting in the other thread, but the problem didn't seem to only be applicable to the add-on.
You don't understand the problem fully. The browser was not the problem. The changes were gone in the expressions.json.
After doing the changes again in the browser, the changes were still not visible in the json. Only after a restart, they were visible in the json.
-
That's correct. The caching doesn't save the changes to the JSON until Reactor shuts down. The changes are present in the engine's structure data, nonetheless.
-
Is it possible to save it more often? I have to figure out what's causing the loss of the expressions, but for now my backup is "worthless". Now, the only way to get the expressions back would be a restore of a full backup of the docker files, but then I will potentially lose other changes.
Any idea why I only lose the expressions and not other changes that are done later?
-
Let's make sure you are getting an orderly shutdown of your container. Try stopping your container (not restarting, just stopping), and then examine the
reactor.log
file. You should see a series of messages that begins as follows (the signal named may vary somewhat)...[###BUILDVERSION###]2023-06-21T15:32:35.467Z <app:NOTICE> Shutdown signal (SIGTERM) received. Stopping Reaction Engine... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <app:NOTICE> Closing APIs... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <wsapi:NOTICE> wsapi: closing... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <httpapi:NOTICE> HTTP API closing... [###BUILDVERSION###]2023-06-21T15:32:35.468Z <app:NOTICE> Stopping Engine...
The messages that follow should be free of errors and point to an orderly shutdown ending with:
[###BUILDVERSION###]2023-06-20T14:57:44.866Z <Structure:NOTICE> Structure Structure#1 stopped [###BUILDVERSION###]2023-06-20T14:57:44.866Z <app:NOTICE> Stopping timers... [###BUILDVERSION###]2023-06-20T14:57:44.866Z <app:NOTICE> Shutdown complete, process ID 1870702
If you see any errors or things that look odd, post them in reply here (please format properly -- see the posting guidelines if you need advice/help).
-
Let's make sure you are getting an orderly shutdown of your container. Try stopping your container (not restarting, just stopping), and then examine the
reactor.log
file. You should see a series of messages that begins as follows (the signal named may vary somewhat)...[###BUILDVERSION###]2023-06-21T15:32:35.467Z <app:NOTICE> Shutdown signal (SIGTERM) received. Stopping Reaction Engine... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <app:NOTICE> Closing APIs... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <wsapi:NOTICE> wsapi: closing... [###BUILDVERSION###]2023-06-21T15:32:35.467Z <httpapi:NOTICE> HTTP API closing... [###BUILDVERSION###]2023-06-21T15:32:35.468Z <app:NOTICE> Stopping Engine...
The messages that follow should be free of errors and point to an orderly shutdown ending with:
[###BUILDVERSION###]2023-06-20T14:57:44.866Z <Structure:NOTICE> Structure Structure#1 stopped [###BUILDVERSION###]2023-06-20T14:57:44.866Z <app:NOTICE> Stopping timers... [###BUILDVERSION###]2023-06-20T14:57:44.866Z <app:NOTICE> Shutdown complete, process ID 1870702
If you see any errors or things that look odd, post them in reply here (please format properly -- see the posting guidelines if you need advice/help).
The exit procedure seems fine.
[latest-23114]2023-06-21T17:47:59.159Z <Rule:INFO> Windows open (rule-grp1myo029o in Weer) starting evaluation; because expression-state-changed GlobalExpression#gTempOutside [latest-23114]2023-06-21T17:47:59.159Z <Rule:INFO> Windows closed (rule-grp1mznck5b in Weer) starting evaluation; because expression-state-changed GlobalExpression#gTempOutside [latest-23114]2023-06-21T17:47:59.160Z <Rule:INFO> Windows open (rule-grp1myo029o in Weer) trigger evaluation result is true (previously true) [latest-23114]2023-06-21T17:47:59.160Z <Rule:INFO> Windows open (rule-grp1myo029o in Weer) evaluated; trigger state unchanged (true); rule state remains SET [latest-23114]2023-06-21T17:47:59.161Z <Rule:INFO> Windows closed (rule-grp1mznck5b in Weer) trigger evaluation result is false (previously false) [latest-23114]2023-06-21T17:47:59.162Z <Rule:INFO> Windows closed (rule-grp1mznck5b in Weer) evaluated; trigger state unchanged (false); rule state remains RESET [latest-23114]2023-06-21T17:47:59.162Z <Rule:INFO> Windows open (rule-grp1myo029o in Weer) evaluation complete [latest-23114]2023-06-21T17:47:59.162Z <Rule:INFO> Windows closed (rule-grp1mznck5b in Weer) evaluation complete [latest-23114]2023-06-21T17:48:07.032Z <app:NOTICE> Shutdown signal (SIGTERM) received. Stopping Reaction Engine... [latest-23114]2023-06-21T17:48:07.034Z <app:NOTICE> Closing APIs... [latest-23114]2023-06-21T17:48:07.035Z <wsapi:NOTICE> wsapi: closing... [latest-23114]2023-06-21T17:48:07.036Z <httpapi:NOTICE> HTTP API closing... [latest-23114]2023-06-21T17:48:07.036Z <app:NOTICE> Stopping Engine... [latest-23114]2023-06-21T17:48:07.039Z <Rule:NOTICE> Motor op lader (rule-liot7yyg in Garage) stopping [latest-23114]2023-06-21T17:48:07.039Z <Rule:NOTICE> Zonnescherm auto IN (rule-lipp4379 in Tuin) stopping [latest-23114]2023-06-21T17:48:07.039Z <Rule:NOTICE> Zonnescherm auto UIT (rule-lhdixs68 in Tuin) stopping [latest-23114]2023-06-21T17:48:07.039Z <Rule:NOTICE> Disk space low (rule-lgyxocj5 in System) stopping [latest-23114]2023-06-21T17:48:07.039Z <Rule:NOTICE> Niels at home (rule-lg7vjm7n in Proximity) stopping [latest-23114]2023-06-21T17:48:07.042Z <Rule:NOTICE> Tessa at home (rule-lg7v960f in Proximity) stopping [latest-23114]2023-06-21T17:48:07.043Z <Rule:NOTICE> Tessa driving (rule-lg7v6f3w in Proximity) stopping [latest-23114]2023-06-21T17:48:07.043Z <Rule:NOTICE> Tessa at work (rule-lg7v3cm6 in Proximity) stopping [latest-23114]2023-06-21T17:48:07.043Z <Rule:NOTICE> Tessa at S&K (rule-lg7uxvzo in Proximity) stopping [latest-23114]2023-06-21T17:48:07.088Z <Rule:NOTICE> Windows open (rule-grp1myo029o in Weer) stopping [latest-23114]2023-06-21T17:48:07.088Z <Rule:NOTICE> Windows closed (rule-grp1mznck5b in Weer) stopping [latest-23114]2023-06-21T17:48:07.088Z <wsapi:NOTICE> wsapi: server closed [latest-23114]2023-06-21T17:48:07.089Z <httpapi:INFO> HTTP server closed. [latest-23114]2023-06-21T17:48:07.090Z <Rule:NOTICE> Motor op lader (rule-liot7yyg in Garage) stopped [latest-23114]2023-06-21T17:48:07.091Z <Rule:NOTICE> Zonnescherm auto IN (rule-lipp4379 in Tuin) stopped [latest-23114]2023-06-21T17:48:07.094Z <Rule:NOTICE> Zonnescherm auto UIT (rule-lhdixs68 in Tuin) stopped [latest-23114]2023-06-21T17:48:07.095Z <Rule:NOTICE> Disk space low (rule-lgyxocj5 in System) stopped [latest-23114]2023-06-21T17:48:07.096Z <Rule:NOTICE> Niels at home (rule-lg7vjm7n in Proximity) stopped [latest-23114]2023-06-21T17:48:07.097Z <Rule:NOTICE> Tessa at home (rule-lg7v960f in Proximity) stopped [latest-23114]2023-06-21T17:48:07.098Z <Rule:NOTICE> Tessa driving (rule-lg7v6f3w in Proximity) stopped [latest-23114]2023-06-21T17:48:07.099Z <Rule:NOTICE> Tessa at work (rule-lg7v3cm6 in Proximity) stopped [latest-23114]2023-06-21T17:48:07.100Z <Rule:NOTICE> Tessa at S&K (rule-lg7uxvzo in Proximity) stopped [latest-23114]2023-06-21T17:48:07.101Z <Rule:NOTICE> Windows open (rule-grp1myo029o in Weer) stopped [latest-23114]2023-06-21T17:48:07.102Z <Rule:NOTICE> Windows closed (rule-grp1mznck5b in Weer) stopped [latest-23114]2023-06-21T17:48:07.111Z <Engine:NOTICE> [Engine]Engine#1 has shut down. [latest-23114]2023-06-21T17:48:07.112Z <app:NOTICE> Closing Structure... [latest-23114]2023-06-21T17:48:07.112Z <Structure:NOTICE> Structure#1 Stopping controllers... [latest-23114]2023-06-21T17:48:07.112Z <Structure:INFO> Structure#1 stopping VeraController#openluup [latest-23114]2023-06-21T17:48:07.113Z <Controller:NOTICE> VeraController#openluup stopping [latest-23114]2023-06-21T17:48:07.117Z <Controller:ERR> Controller VeraController#openluup is off-line! [latest-23114]2023-06-21T17:48:07.952Z <Structure:INFO> Structure#1 stopping HassController#hass [latest-23114]2023-06-21T17:48:07.952Z <HassController:NOTICE> HassController#hass stopping [latest-23114]2023-06-21T17:48:07.965Z <wsapi:WARN> client close from unknown connection? "192.168.1.174#25" [latest-23114]2023-06-21T17:48:07.966Z <wsapi:WARN> client close from unknown connection? "192.168.1.174#24" [latest-23114]2023-06-21T17:48:07.983Z <HassController:NOTICE> HassController#hass websocket closing, 1000 [latest-23114]2023-06-21T17:48:07.985Z <Controller:NOTICE> HassController#hass stopping [latest-23114]2023-06-21T17:48:07.988Z <Controller:ERR> Controller HassController#hass is off-line! [latest-23114]2023-06-21T17:48:09.266Z <Structure:INFO> Structure#1 stopping DynamicGroupController#groups [latest-23114]2023-06-21T17:48:09.266Z <DynamicGroupController:null> DynamicGroupController#groups stopping [latest-23114]2023-06-21T17:48:09.267Z <Controller:NOTICE> DynamicGroupController#groups stopping [latest-23114]2023-06-21T17:48:09.268Z <Controller:ERR> Controller DynamicGroupController#groups is off-line! [latest-23114]2023-06-21T17:48:09.279Z <Structure:INFO> Structure#1 stopping SystemController#reactor_system [latest-23114]2023-06-21T17:48:09.279Z <Controller:NOTICE> SystemController#reactor_system stopping [latest-23114]2023-06-21T17:48:09.281Z <Controller:ERR> Controller SystemController#reactor_system is off-line! [latest-23114]2023-06-21T17:48:09.288Z <Structure:INFO> Structure#1 Final data sync... [latest-23114]2023-06-21T17:48:09.288Z <default:INFO> Closing container Container#rulesets [latest-23114]2023-06-21T17:48:09.289Z <default:INFO> Closing container Container#rules [latest-23114]2023-06-21T17:48:09.289Z <default:INFO> Closing container Container#reactions [latest-23114]2023-06-21T17:48:09.289Z <default:INFO> Closing container Container#states [latest-23114]2023-06-21T17:48:09.316Z <default:INFO> Closing container Container#default [latest-23114]2023-06-21T17:48:09.316Z <default:INFO> Closing container Container#expressions [latest-23114]2023-06-21T17:48:09.318Z <Structure:NOTICE> Structure Structure#1 stopped [latest-23114]2023-06-21T17:48:09.319Z <app:NOTICE> Stopping timers... [latest-23114]2023-06-21T17:48:09.319Z <app:NOTICE> Shutdown complete, process ID 1
I did get a disk space notification, so my first thought was that that was the problem. But I believe there always was enough space, more than 1 gb at least.
Does Reactor do something more then only give a signal that disk space is low? Maybe save the cache or something in that line.
-
Reactor warns only when disk space starts to get low. There are attributes saved where you can write rules to respond, but Reactor doesn't take any action of its own.
-
The only lead I have is the disk space, I don't know what else it could be, although I cleared some space as soon as I got the notification.
I don't know what to do to further analyze this. I will monitor this and see if it happens again.
It would be helpful if Reactor could save the expressions to the json more often.
-
Restarting reactor from reactor itself after changing any global expressions or making new global expressions is doing the trick for me currently.
But I am using MSR via the unofficial addon by @mrw298 .