Clear the Cache

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.

Hej @BrutalBirdie,

thank your for your welcoming and the finger pointing :wink:
I just reinstalled Openhabian 2.4 today in the morning on a Vanilla Raspberry Pi 3B and now everything seems to work without flaws.
I was running some other things, such as the Unifi Controller, on the previous Raspberry.
So now I am happy installing addons, bindings etc. The weekend is saved… :smiley:

1 Like

What do you mean by “vanilla” ? Did you install Raspbian or did you use the openHABian image ?

I did use the openHABian image on a brand new RaspberryPi.

@rlkoshak I cannot delete files in my cache because they are read only for what ever reason. Even with the help of google and this forum I am not able to solve the issue. Can you please help?

rm: cannot remove 'cache/org.eclipse.osgi/198/0/bundleFile': Read-only file system                                         
rm: cannot remove 'cache/org.eclipse.osgi/156/0/bundleFile': Read-only file system                                         
rm: cannot remove 'cache/org.eclipse.osgi/91/0/bundleFile': Read-only file system                                          
rm: cannot remove 'cache/org.eclipse.osgi/114/0/bundleFile': Read-only file system

Try this first :
openhab-cli reset-ownership

And then clear the cache