Hi, I have a Thing of a new type that’s currently only in the 3.2.0.SNAPSHOT, so that’s the version I’m running. The Thing type is Heltun HE-RS01 and it worked perfectly well until I rebooted my Pi today.
Now everything still works perfectly well in as much as functionality is concerned – all Items are in place, rules are working etc. but when I try to open the Thing’s page, it’s empty; all I see is that it’s ONLINE and there’s a Delete Thing button.
There are no tabs for the Channels or Code and nothing is listed. The only option is to delete the Thing, which I’m hesitant to do because it’s central to my setup, and also I don’t want to have to do this after every reboot.
Nothing shows in the logs while I open the Thing page.
Does anyone know what might be the problem? Every other Thing page works fine, including other Z-Wave Things.
What is the nature of the reboot? Did openHAB have a chance to close down normally or was it killed abruptly? I ask because if it was killed abruptly it likely didn’t finish writing out it’s memory to the JSONDB which caused you to lose a bunch of stuff.
Luckily before it writes to that file it saves a backup. Go to $OH_USERDATA/jsondb/backup and restore the most recent version of org.openhab.core.thing.Thing.json to the jsondb folder. Make sure openHAB is not running when this occurs. That will get you back to the state it was in before the write was cut off during the reboot.
Hi, thanks for replying. It was a clean shutdown (sudo shutdown with the power off a couple of minutes later) because I needed to move the Pi to another wall socket.
I’ve searched after those backups and, interestingly, they are all younger than the restart:
openhabian@openhabian:/var/lib/openhab/jsondb/backup $ ll *org.openhab.core.thing.Thing.json
-rw-r--r-- 1 openhab openhab 147K Oct 26 19:08 1635268097692--org.openhab.core.thing.Thing.json
-rw-r--r-- 1 openhab openhab 147K Oct 26 19:08 1635268127705--org.openhab.core.thing.Thing.json
-rw-r--r-- 1 openhab openhab 147K Oct 26 19:09 1635268161268--org.openhab.core.thing.Thing.json
-rw-r--r-- 1 openhab openhab 147K Oct 26 19:09 1635268176428--org.openhab.core.thing.Thing.json
-rw-r--r-- 1 openhab openhab 147K Oct 26 19:09 1635268191196--org.openhab.core.thing.Thing.json
openhabian@openhabian:/var/lib/openhab/jsondb/backup $ uptime
22:06:24 up 3:08, 1 user, load average: 0.04, 0.03, 0.00
They’re also very close to each other, I don’t know why.
I don’t really know that I lost anything – the Items work fine! Would my symptom (the empty Thing page) indicate a database inconsistency?
Edit: The most recent backup, as you say, is identical to the live file:
openhabian@openhabian:/var/lib/openhab/jsondb/backup $ diff 1635268191196--org.openhab.core.thing.Thing.json ../org.openhab.core.thing.Thing.json
That means you’ve made at least five changes to Things since the problem first happened or you’ve restarted openHAB at least five times. Unfortunately unless you’ve some other backup the changes are gone.
As you can see, Items are stored in a different file. The Items would continue to work just fine. The Links are also stored in yet another file. But usually the symptoms that you describe is caused by a partially written or corrupted Thing jsondb file and those Things not listed would not be working. If they are in fact working the problem lies elsewhere, probably a bug in the UI.
Thanks. Yes, the Thing in question works fine, switches are toggling happily. Is there anything I can do to provide more clues?
How about this: I’m inspecting the XHR request in the UI. It’s a GET http://openhabian.local:8080/rest/thing-types/zwave:heltun_hers01_00_000 and the server response is 204 No Content. This seems a bit anomalous, you’d think something would be logged, but nothing shows up (at least not with my current log setting).
Requests to other Things yield the predictable long JSON.
Also I’ve looked in my current Thing json in jsondb, and it’s correctly described there, with all channels, bridge connections, configuration etc. The file has the normal access rights. Any idea why the backend would not serve that particular section of it? Are there some kind of checks in the backend that are now failing and which cause a 204 response?
I’ve never seen anything like this reported before so I’ve no ideas what could be going wrong. The only thing I can think to check is to use the REST API Docs to make the call to get the Things and see what is returned. Maybe repeat that using curl to see if you get a different result.
But I’m not sure what to do with the result of either test beyond opening an issue to see if the devs can determine what is going wrong.
After two more reboots, things magically returned to normal… I have no idea what the problem was. I did nothing except reboot a couple of times.
Oh, one of the reboots was a soft one (sudo reboot) and then the Pi booted in some weird non-network mode and, rather than connect it to a screen, I just hard rebooted it, and then it worked.
Thanks for trying to help!
I just noticed that I have the same issue with a thing. I have no idea when this appeared since I haven’t checked it for years However, all the items connected to the Thing works as before so I suspect it’s just a UI problem (?).
I did a few restarts of Openhab last week, to minimize the Log4j security issue, which might have triggered it. I used:
sudo systemctl restart openhab.service
I’ve done 2 reboots (one sudo reboot and one sudo shutdown now -r) of the Pi now and the issues persists. I’m running Openhab 3.1 on a RPi 3b, I will update to latest stable release now and see if that helps.