OH4 no reloading of changed rules files

As I have an “empty” server for tests and dev on my Windows 10 PC, I will test again on that OH server but I am already confident that it works on Windows.

From my experience on a Windows machine this error occurs when you start openHAB with a web client still trying to connect. I usually find that after seeing these errors it is not possible to connect to the GUI until a restart.

I found my problem: Tyying to find the problem, i used the normal notepad to make small changes. All changes issued a correct reload of the file. I went back to my normal development environment “Visual Studio” and repeated the changes. No reload was done.
As a complete fool I didn’t realize, that I should have changed the environment to OH4 directory too.
I very sorry for the trouble.

As a moderator, may I request you to next time please provide all the relevant information upfront with your initial post. That is at least hw, os, relevant environment, exact versions in use and the conditions to reproduce the error.
It’s really annoying for a volunteer that’s willing to help you with your issue when he does not know about these and has to makes assumptions that can be false.
That’s quickly leading to frustration on everybody’s part.
Thank you.

Can you mark this post as “solution” for clarity? Glad that it’s now working for you.

I am actually seeing the same issue sporadically.

  • touch file.items does not reload
  • Adding a space in a string usually triggers a reload, right now, it does not

I am editing as I always do, using VSCode.

I can unlock the situation by… wait for it… stoopping the ZigBee (Ember) coordinator.
It sounds unrelated but as soon as I stop the coordinator, I see the changes I previously made, dequeueing and reloading as they should have been earlier:

I did notice with this one binding, I probably should testing with others but the symptom looks rather strange…

So there is no issue in the items files file preventing to load them, otherwise they would not load at all.

Out of curiosity, I tried with a “random” binding. I used astro and it did not help.
I previously added a space (in a string), it triggered a reload, then removed the space, it did not trigger the reload.
Stopping the ZigBee coordinator does unlock the issue reliably:

2024-05-10 17:37:52.505 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'office.items'

right after the avalanche of:

2024-05-10 17:37:50.154 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'zigbee:device:c708203273:00124b002e571807' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (BRIDGE_UNINITIALIZED)

Restarting the z-wave binding also appears to unlock the issue.
So does sudo /bin/systemctl restart openhab.service but all those options are overkill to just reload a file.

Addition:
I think the issue is not that is does not reload, it is that it:

  • sometimes realoads near instantly as the user expects
  • sometimes lags several minutes… and then finally reloads

If you leave it enough time, it will eventually reload but I have seen times where it takes several minutes. I am running into this issue more since I have more MQTT activity…

I am not sure how the threading is handled but it feels like the file watcher is running but sometimes does not get a chance to “speak up”.

1 Like