Configuration model 'default.rules' is either empty or cannot be parsed correctly!

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?

1 Like

I get that for almost all my rules, not sure what triggers it but unless the log shows a specific error it seems safe to ignore it.

1 Like

Ok, good to know. I guess openhab2 is still pretty new and might have a lot of problems like this still… :slight_smile:

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.

No, NFS, but could be a similar issue with that maybe?

still no solution found for this ?
seeing same stuff in the log and i am also using designer , tried notepad ++ in UTF8 etc …

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?

Haven’t digged deeper, but I haven’t had any problems related to it, even though I see the warning from time to time…

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.

1 Like

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 …

I used Notepad ++ and I used to have these problems. Since I used Geany, I have not had them again.

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.

There you go:

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)