Dead system? No things or items listed in Paper UI

Hi all!

Following a double power outage this morning, my production environment is seriously injured. I am running a RPi3 with system and files on an SSD. Due to life (a k a newborn son) I have been absent a bit too long to find my way around Debian and OpenHAB with any ease, but I note that I have zero items or things present in PaperUI. Sitemaps, item-files etc seem to be present. My guess is that the outage corrupted the PaperUI database (Jetty?) and since I use that for defining things, the items have nothing left to connect to.

While I do back configurations nightly, I’m not running any image backup regularly. The last one I have seem to be pre-move-to-SSD (Dec 19). Not sure what I will lose by going back, but that might end up being my only way forward. My questions then are these;

  1. Is there any reasonable way to a) verify that db corruption is my issue and b) if so, attempt any kind of repair? (I am suspecting that “nope - be smart before the disaster, stupid” is the answer here, hrmpf)
  2. Am I correct that only a full image backup normally backs up PaperUI’s db? E.g. its not part of the “common” backup scripts in the docs=
  3. Does anyone know of any challenges with restoring a SSD transitioned RPi3 to once again run from the MicroSD? Is there anything special I should be thinking about?

Also, let’s not think too much about the fact that my experimental, and currently very broken, development system is happily backing up to AWS every night. :slight_smile:

Thanks!

Petter

There’s a clue here to check things db filesize -


to confirm your suspicions.

There’s a clue here to check things db filesize

Thanks, will check it out! :slight_smile:

Petter

  1. Yes, as rossko57 indicated, check the sizes of the JSONDB files. If they seem to check out, open the files (they are text files) and look to see if there is any obvious corruption. Stuff like weird characters or the file just seems to end abruptly. JSONDB automatically gets backed up on every change and at other times. If you do have a corrupted JSONDB, look in the backup folder in the same place (/var/lib/openhab2/jsondb/backup) and copy the most recent backup files one folder up to restore the backup.

  2. Incorrect, openhab-cli backup also backs up and restores the JSONDB and other stuff in /var/lib/openhab2.

  3. Can’t help with that.

1 Like

Thanks a bunch, Rich! That sounds quite encouraging. I’ll put some time into that. :slight_smile:

@rossko57 @rlkoshak

There’s a clue here to check things db filesize - to confirm your suspicions.

If you do have a corrupted JSONDB, look in the backup folder in the same place (/var/lib/openhab2/jsondb/backup) and copy the most recent backup files one folder up to restore the backup.

I owe you both a beer or your beverage of choice! The things-json-file was indeed screwed up. Copying one back from the night before got my devices back; all item links are in files and channels seem to be fine. E.g. normal operation seems restored. I am halfway into finally lifting my development Pi4 into service as prod - the only question remaining is if I can muster the energy to finish that work and finally get my rebuild complete. Meanwhile though, we can get our blinders up and our lamps to turn on and off again.

Thanks a bunch! :fist: :+1: :pray:

Petter