Clear the Cache

Yep, for any OS too. :slight_smile:

1 Like

Be very careful with this instructions.

I am on windows, installed OpenHAB 2.3 with Chocolatey.
Then I used PaperUI to install necessary bindings and actions
I used text files to configure bindings and write my items and rules.

Then on start of OpenHAB I got an error regarding HTTP binding with a key that I couldn’t find in any file - but which I finally found in PaperUI to be some (already deleted) comments in my files, which I couldn’t delete in PaperUI

So I found this thread, followed the instructions (deleted cache and tmp directory), started OpenHAB and the log file didn’t stop anymore for the next 15 minutes…
OpenHAB installed many AddOns I had never installed, of course they were spitting out every possible error message. My conf/services directory previously had 6 files, now it’s 90 (automatically added) files. My conf/transform directory previously had 5 files, now it’s 35 files (mios transform files were added automatically), …

This will take some time to clean up the mess :frowning:

This is a known bug. An issue is open and I think it might already be fixed in the milestones and snapshots.

@StefanMUC track it here: Offline Archive (addons.kar) installs all Add-Ons · Issue #729 · openhab/openhab-distro · GitHub

It has nothing to do with the instruction in this thread (which work fine)

Yeah, the Instructions here are not wrong - that’s not what I wanted to tell - but you have to be careful to follow them with current OpenHAB release, because they have side effects.
But it did cost me about two hours to fix my OpenHAB installation after I followed the instructions - i finally had to delete OpenHAB directory and start from scratch and hopefully found all bindings again that I need. Just found out today that I was missing one binding.

Now I won’t install bindings (and more) with PaperUI anymore but use addons.cfg, thats more convenient and so much easier to backup. Should have done that before and ignored PaperUI.

By the way: This is not what caused you the problems (the use of PaperUI)

The root-cause of your issues is the following: the offline addons .kar file (which comes with Choco) has a problem and when it is copied to the userdata/addons subfolder, OH2 starts to install every single available Add-on (actions, bindings, transformations, persistence, etc, etc). Of course, since none of these Add-ons are configured… logs explode

This has been already fixed in the latest Milestone Release (2.4.0.M6)

Also, as a second step, the Choco installation method is beening updated not to include the Offline Addons package anymore. Users can now use PaperUI to install the addons that they really want.

1 Like

Exactly, I understand the problem (but I didn’t have this one week ago as I installed OpenHAB with Choco). But that’s what made restoring backup from conf directory not so easy as Addons were missing after fresh install. So it’s better to use a config file which I can compare to earlier versions than to use a webinterface that looses it’s changes after a fresh install.

It is expected not to have any addons installed when you restore only conf subdirs on a fresh OH2 system.

The addons (*.jar files) are stored in userdata/cache & userdata/tmp subdirs and you don’t really need them, since OH2 will redeploy them on a new system. Actually, you shouldn’t back those stuff up (since they are the older versions).

The bug that you had on your previous system (ALL addons were installed) is not a normal condition.
The fresh install was empty of addons, something which is normal. You could have used PaperUI to install the new addons and you would have been fine.

Of course, the use of addons.cfg makes your life a bit easier (and the situation more “clear” I would say) in these upgrade scenarios. This is what I do also.

An alternative method to configuring addons.cfg and restoring it (to auto-deploy only the selected addons) is to backup stuff in userdata/config. Anyway, a full backup includes (on top of conf) everything in userdata (except cache & tmp).

Thanks, this was the information I was missing. There are quite many files there ^^

1 Like

I’m using openHAB over RPI and mqtt my items is not responding after clearing cache and Tmp files
What can I do

1 Like

It might save some heart attacks if, along with the instructions for how to clear a cache, it is pointed out that one may need to restore file ownership with:

sudo openhab-cli reset-ownership

I had cleared my cache, and then karaf / openhab wouldn’t restart, with logs stating “could not launch framework” and couldn’t initialize storage, etc.

After running:

sudo openhab-cli reset-ownership

Everything was working again.
Anyway, Putting this here for someone else who runs into the same surprise.

3 Likes

Thanks! Crisis averted :slight_smile:

good catch Ben
@rlkoshak as op, is this something that should be included in 1st post in case of issues.

@bdm what is your platform and version ect. to identify where this issue would need attention because not hear of such

clearing the cache shouldn’t have anything to do with file permissions. You are deleting files and folders created by openHAB so after you clear the cache those files and folders are recreated by openHAB so the ownership will be openhab:openhab.

Either the openhab-cli script was changed and an issue needs to be filed, or bdm did some other stuff before or after running the cache clearing that caused the problem. In either case, it was the OP that was the source of the problem. I’m hesitant to add warnings to the OP that are not directly related to the OP.

1 Like

Hi @Andrew_Rowe, I’m running Openhabian 2.4 on Raspberry Pi 3B.

@rlkoshak, I don’t think I had done anything else other than delete the cache that I can recall. I had been trying to debug my caldavio at that time (shelved for now), I beleive, so it is possible that someone’s post somewhere had guided me to do something - but I’m pretty sure I wasn’t messing around with OH system files or permissions, that would certainly have stuck out (and suggested an immediate fix for the startup problem). I was sticking to the caldav-specific files, I’m pretty confident.

Regardless, it appears that Juan ran into the same challenge as I, so I’m glad I posted the potential solution for others to find.

1 Like

If you restarted OH as a user other than openhab, that would have done it.

@rlkoshak That’s possible - I may have used sudo.

Hello everybody!
I currently have problems with installing Addons etc. through PaperUI, I am running Openhabian 2.4 on RaspberryPi 3 B. The log is full of red entries after trying to install Addons and I already tried clearing the cache with the commands stated above here in this thread but nothing seems to help.
sudo /etc/init.d/openhab2 stop
sudo rm -rf /var/lib/openhab2/cache/*
sudo rm -rf /var/lib/openhab2/tmp/*
sudo /etc/init.d/openhab2 start

I will once again try to install the whole thing new (as stated here https://www.openhab.org/docs/installation/openhabian.html) and hope it works from then on.

Hey @maatz first of all

Welcome to the openHAB Community :heart:

But now to the finger pointing :smiley:
Thread hijacking is not nice, I see have a problem and tried to clear the cache but still did not succeed.
You won’t get many answers like this.
I would recommend reading this topic How to ask a good question / Help Us Help You :slight_smile:

Also your post is 14 Days old and you did not state if you solved the problem or not. And if you solved it leave a note how for other people with the same problem.