OH3 Thing.json suddenly empty

Hi all,

All of my automation suddenly stopped working today. After a lot of checking and trying to work out why, and a couple of reboots, I think I’ve discovered why…

org.openhab.core.thing.Thing.json is empty, all other .json files look to be intact.

I’ve been taking regular backups, but had done a fair amount of tweaking of rules etc since the last back up - is it safe simply to take the latest Thing.json and copy it into the jsondb directory, or restore from the last known good backup and copy in the latest rules.json file?

On a related question, I’ve been using the UI to configure everything so far, but the only method of config-management seems to be running openhab-cli backup is there a way of managing file versions in a way akin to file versioning?

Cheers
James

Stop the openhab.service before you copy the .json database over the old one.

I want versioning for my system and am currently coding this into openhabian. Currently its a little rough around the edges and not ready to let out in the wild.

1 Like

this happened to me too. did your system slow down (lights turn on 2 minutes delayed) befor this happened?
I had this a few times and since i converted all dsl rules to ECMA, this problem is gone. I think it is something in the dsl-rule engine or something i did inside the rules.
all of my rules wich can have caused this problem are in the thread. maybe you can find a simularity?

https://community.openhab.org/t/dispatching-event-to-subscriber-org-openhab-core-internal-items-itemupdater-takes-more-than-5000ms-and-thing-are-deleted/113756

Hi @DaDen,

Yes - I can indeed find a similarity, I migrated a couple of OH2 rules over on the day before - I left a couple of the more complex ones as rules dsl rather than converting to JS (ran out of time), next morning the following appeared in the logs about the time things.json was made empty:

2021-01-17 10:52:01.044 [INFO ] [openhab.core.model.script.FanControl] - EnSuite Fan: ON
2021-01-17 10:52:10.865 [WARN ] [ab.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.openhab.core.internal.items.ItemUpdater@1ac5fdc' takes more than 5000ms.
2021-01-17 10:52:35.904 [WARN ] [ab.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.openhab.core.internal.items.ItemUpdater@1ac5fdc' takes more than 5000ms.
2021-01-17 10:52:40.234 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

That looks to be it, thankfully the backup seems to be working ok so nothing appears to be corrupted, just need to re-migrate those rules I had done, and convert those I hadn’t!

Cheers
James