[SOLVED] All Things lost from openHab

Same thing happened to me: org.eclipse.smarthome.core.thing.Thing.json was zero bytes. I restored from a backup just a couple of hours earlier, problem solved. Thanks!

Just another note on this. After restoring the backup, I saw this in openhab.log:

 Error writing JsonDB to /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json. Cause /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json (Permission denied).

I had to change the permissions back to openhab:openhab (I think) using chown to solve it.

This same thing happened to me today.

Some thread in Openhab was getting a null-pointer exception and was looping several times a second, casuing syslog to overfill (it was 30GB and filled the whole root partition).
Openhab was still working, but when logging in via the cli, it complained that it didn’t have room to create some temp files, so I discovered the situation.
I restarted Openhab and trimmed the syslog. Once I got in, everything was gone - all items, all things, all users, everything. And the same with all backups - every single interesting file is 0 bytes.

I had listened to advice from maintainers on these forums where I was told to abandon textual item definitions in favor of using the UI. Previously I had a git where I had version control of everything, but I read that the config database was now so stable that I didn’t need to. So I abandoned that a few months back.

I was finally getting happy with my OH3-setup. I had 200 items and 135 things, and had just finished converting everything to semantic modelling, linked with Google Assistant.

There’s no way I will redo all of this, and I’m sorry to say I no longer have confidence in this project.
I appreciate all effort put in by all maintainers. I’ve used OpenHAB for around 8 years, I think.
But it seems this is a perfect time to try HomeAssistant instead.
Maybe I’ll be back, time will tell.

UI configs and git are not mutually exclusive. It’s all text files that work quite nicely with git. No one would recommend against using git even for the JSDONDB configs. I don’t know who may have suggested to not use git but they were frankly wrong to do so, or possibly there was a misunderstanding between the two. It doesn’t matter how stable and reliable JSONDB is, git is still useful and recommended if you know how to use it.

And no one would recommend running without any backups regardless of how OH is configured. Something can always go wrong. If someone suggested you run without backups, again they were wrong or there was a misunderstanding. You always need a backup and that backup needs to live off the machine. A copy of files on the same SD card is not a backup.

I’m sorry you lost your config but the root cause appears to be a lack of backups. Either you were mislead or misunderstood that somehow you don’t still need backups and that’s simply not true.

I wish you luck with Home Assistant, but don’t forget to take backups there too.

1 Like

Thanks for your reply.
I’ve always admired your detailed posts and the patience you show.

As I guess you understand, my post was written in utter sadness and frustration.
Of course I should take regular backups. My latest one was from October. Since then I’ve split my setup in a master/slave setup and made lots of adjustments for semantic modelling, and I was in the state of “just one more change, then I’m happy about it and make a baseline/backup”, which of course is stupid and makes it all more frustrating.

I appreciate OpenHAB and all effort that’s been put into it, and as a developer I’ve also made mistakes in error handling when dealing with filesystems, so I totally get it. I haven’t even contributed any code here even though I’ve used the system for many years, so who am I to complain.

1 Like