GREAT problem after update to OPENHAB3

  • Platform information:
    • Hardware: RPi 3
    • OS: openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 3
  • Issue of the topic:
    I updated from 2.5 to 3 without issues. I started to work with OH migrating my items from text files and building semantic model. But I had two times the same problem: after restarting the service all my things are gone. I don’t have anything in logs that can explain this behaviour. What can I try?

As a “first aid” measure, check your userdata/jsondb folder. Most likely the file org.openhab.core.thing.Thing.json got corrupted. In the same folder you find a subfolder called “backup”.

Now stop openhab. Then, take the most recent file from there (e.g. 1611913631152–org.openhab.core.thing.Thing.json) and copy it to the userdata/jsondb folder. Then rename it to org.openhab.core.thing.Thing.json

Now start openhab again, and your things should be back.

I already restored a backup and everything is up again. But I never had this kind of problem with previous versions. And two times in less than a month with OH3. What can I do/check to avoid this problem?

Nothing for the time being other than to let OH run. Github issue is open watch it to get notified on progress.

Oh sorry. I didn’t know it was already an open issue on Github. I’ll check it. And in the meantime I’ll do a lot of backups…

See [jsondb] Restore zero byte files from backup by MikeJMajor · Pull Request #2155 · openhab/openhab-core · GitHub

So it’s fixed in the current snapshot.

The current snapshot should now automatically restore a zero byte file, but I can’t help think there’s still some underlying issue causing the file to get corrupted in the first place.

Perhaps its the out of memory issue which is already fixed in 3.0.1 or it could be this:

Certainly on my RPi3 3 I often see the OH process being killed during an upgrade due to it taking too long to shutdown.