Wiped my entire installation

Quite panicked here right now, hope anybody can help me. This morning I found some old packages hanging around for no good so I did some purging. One of them was the old (not longer installed) openhab2-online which apparently still had config files left. I purged the package. Big big mistake. It seems that purging totally wiped my /etc/openhab2, /usr/share/openhab2 and /var/lib/openhab2 although those directories also belong to the installed openhab2 package. As you can understand things doesn’t work well now. I had a backup of /etc/openhab2 (which is the folder I’ve put most effort in) but not the others. So I did a apt-get install --reinstall on the openhab2 package to get the files back and after that I can at least start the openhab2 service again and it says it’s running. However I still can’t reach anything on ports 8101 or 8080 and I get nothing in /var/log/openhab2 so I don’t know where to start searching. What did I miss???

edit: Ok, getting forward. Uninstalled openhab completely and then installed latest snapshot instead. Now I can actually log into Karaf. Get the feeling I have many hours ahead of me before everything is working…

As you say you fail to connect to port 8101, I’d check /etc/default/openhab2 first.
Use ps to see if java is running with the parameters set therein .
Check your logs to find hints where OH starts to fail or to operate. If you don’t find any logs, start OH using start_debug.sh. Log levels are permanently defined in /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg so you could change 'em there if you don’t manage to access the Karaf CLI (port 8101, that is).

Check for existence of /var/lib/openhab2 and subdirs. It’s recereated on installation, but likely your thing database is missing (jsondb/org.eclipse.smarthome.core.thing.Thing.json). If you don’t have a backup check for copies in the backup dir there. If you don’t find any copy I’m afraid you have to go all the way of configuring your things and items through the UI (unless you have already done this via files in /etc/openhab2/…).

Good luck…

PS: and I don’t wanna blame you, but you don’t have any file- or device-level backup of your box, do you?
Go read up on Amanda in openHABian when you’re done recovering.

No, I haven’t set up any real backup of anything but /etc on this machine. I know, I should have :blush:

Anyway now I’m stuck on a completely different problem. I tried going through the general settings through paperUI, setting up locale and timezone etc. Now suddenly I can’t reach anything in the paperui menus anymore and whatever I do the log says the following:

12:04:25.426 [ERROR] [rthome.io.rest.internal.RESTActivator] - There should ALWAYS a local provider available, as it is provided by the core.

I get the feeling my locale changes weren’t saved correctly and now I’m in the blue. Anyone knows how to fix?

I also get popups saying “ERROR: 503 - Service Unavailable” all the time in paperui, don’t know if it’s related?

Nah, that output is useless without more (log and config) context.
Try bundle:restart for the PaperUI module.
If that doesn’t help, move away your rules files (!) and restart OH. Don’t move 'em back until your setup is working satisfactorily.

Restarting the bundle or restarting entire openHAB doesn’t help. After restarting openHAB I get some errors though, I put them here: https://pastebin.com/apC4AqBi

My rules I haven’t put back yet so currently the rules folder is still empty. Thought I’d get the basics running first…

Phew, sounds like something deep inside Java and Karaf file setup is wrong, but just guessing. Could be anything in fact.
Can’t help there. Now as we don’t know what files you ultimately deleted, you can spend some more hours searching,
but I think your best and fastest bet is to setup another machine from scratch.

Well, now I am on scratch. On the same machine but I wiped everything in between. And things started working until I tried setting up language and timezone in the paperui settings, guess something is broken there (after all it’s a snapshot version). Question is if I need to wipe again or if I can just reset the locale/timezone settings somehow…

When you “wiped” the current setup did you do it with another purge? Otherwise, you can attempt to restore an installation to defaults with the following (say yes to the prompts if any come up):

sudo apt-get -o Dpkg::Options::="--force-confask" -o Dpkg::Options::="--force-confmiss" install --reinstall openhab2

A purge gets rid of any file associated with the package, which unfortunately for you means that it’ll get rid of files created when that package was in place.

Well you’ve got another problem that your inability to set timezone is just another symptom of, buf if that’s all you want to do, you can do that in /etc/default/openhab2 such as in
EXTRA_JAVA_OPTS="-Dosgi.clean=true -Duser.timezone=Europe/Berlin -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0:/dev/ttyACM0"
And for the locale there’s options in services/runtime.cfg.

Well, after another full wipe I’m back on track now, starting to configure up all my things and items (manually). I haven’t dared touching the locale or timezone settings this time though… If I leave them be for the time being, will there be trouble with my rules? I don’t really care what timezone OH thinks it is in as long as it doesn’t do cron stuff two hours late or early :slight_smile:

Ok, I feel stupid again… Where the heck do I find the basic configuration for a Binding, like which device to use for the z-wave binding? Clicked through every choice I can find in paperui multiple times and I can’t seem to find it…

umm i found the zwave binding just under addons-bindings.
the configuration is done on the z-wave server. (i have a raspberry and a zwave shield, running a razberry server, where i configure all z-wave devices. they are just linked to openhab. which z-wave hardware (stick, server?) do you use?

Found what I was looking for. Simply a question of going to the inbox and clicking the plus to set up the controller. Long day today…

1 Like

I think when you’re setup again it would be wise to use the snapshot’s backup feature to make a zip file:

sudo ./runtime/bin/backup /path/to/backup/file

or on apt/yum installs:

openhab-cli backup /path/to/backup/file

Otherwise, let us know if you’ve got any troubles in getting back online quickly!

1 Like

Ah, thanks! Had not heard of the openhab-cli before, seems nice. Actually I already have a scheduled task that makes a zip file of entire /etc and copies it to a nas (and from there it’s then copied to an offsite backup nas), will be perfect having this new zip copied in the same way :slight_smile:

I’m starting to get all setup. Most essential things and items recreated (using a better naming convention than before) and most rules back into operation. Now I really don’t dare touching the regional settings in paperui though since it completely broke my openhab last time and I don’t know how to recover. Any ideas about what might have happened?

Ah, yes but to restore an instance of openHAB to exactly the same state, some files in /var/lib/openhab2 are necessary as well. Being able to restore from that zip file with the following line is helpful too :wink: :

openhab-cli restore /path/to/file.zip

Sounds nasty! I’ll try to see if I can replicate that behaviour. This happened on a fresh install?

Yep, completely. If I’d been completely calm I’d collected more info about the problem, but I was in kinda hurry to get things up and running. But as I remember things I did something like the following:

  1. Installed the package (2.1.0-1)
  2. Went to the web interface and choose the “stanrdard” option (second from left)
  3. Went into paperui and started configuring. I might have installed the Tellstick binding and maybe the habmin UI first.
  4. Went into configuration (in paperui). I started from the top so probably I changed the network settings first. No persistence yet so after that I got to the regional settings.
  5. I’m Swedish, so I changed language to swedish and country to Sweden. Picked a random +1 time zone, left location empty and clicked save. I think it was right after that my problems described above in the thread started.

Hope this gives you something to look at. Sorry again for the amount of “might” and “maybe” above :wink:

Yep, as mentioned in [solved] Wrong TZ config, errors on startup, it’s a confirmed bug. Hopefully there will be a fix for it shortly.

1 Like

Thanks a lot @Benjy! I guess I can live with the wrong time zone until it’s fixed :slight_smile:

I should have read this thread in advance…

I also purged openhab2-offline and it happened to me too. Fortunately I had a nightly backup also from /var/lib/openhab2.

An updated package of openhab2-offline would be good, which checks on purge if there is another package (openhab2) with the same directories.
This would prevent others to fall in the same trap.

1 Like