I have just started writing my rules using the designer, they seem to work and I get no errors in the editor. But still I get the same warning in the logs all the time:
18:53:00.361 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'default.rules'
18:53:00.362 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'default.rules' is either empty or cannot be parsed correctly!
18:53:00.370 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.rules'
I have tried everything, comment out rule after rule, erasing everything, adding a single super easy rule, whatever I do I get that warning. Is it a bug?
Do you edit the files on a Samba share? I always get this kind of log messages when I do that. For me it looks like OpenHAB is too fast in reading the file before the OS has updated the content.
i have the same, but it doesn’t affect anything. I think that while saving openhab detects the change of the rules file and tries to read it, because it is not fully saved correctly, it cannot be parsed correctly. Afterwards, openhab reads the complete file and anything is okay - no reason to worry about, or?
You are right …
I have mounted the folder /etc/openhab2 with sshfs on my mac an had the same error.
When i try to edit the rules on the server with vi, everything is fine …
So… openhab is a little bit to fast with reading the configs.
I get this as well, after I changed “something” in my smb.conf yesterday (forceuser=openhab, etc). So it’s likely a samba issue. The rules are working though.
Reffering to another thread it is most likely that the parser does not like either “tabs” that happen when using certain editors and creating indents for better formatting and when having orphan “spaces” = " " at the end of lines …
I made the effort to remove all tabs within lines and spaces at the end of lines manually and then the error disappeared. But its not worth the effort as everything else works fine …
This is not a problem, this is due to the way the system handles the file.
You can safely ignore this error
When you save a file two things happen. OH will detect the change and try to parse the file and fail. Open the second event, it will succeed. That’s all.
There is a more detailed explanation on the forum but I can’t find it right now.
I had the same problem (but the file did not work at all) and was using Notepad++.
The solution was to change file encoding from UTF-8-BOM to UTF-8 (which whysoever was default)