Clear the Cache

error
debug
Tags: #<Tag:0x00007fd32265e6e8> #<Tag:0x00007fd32265e5a8>

(Rich Koshak) #1

I got tired of retyping this so am posting a new thread I can link to later.

Often when one encounters a problem with OH, particularly after an update, OH will refuse to run or certain parts of OH stop working. Some reported errors include:

  • 500 or 404 errors when accessing the UIs
  • lots of exceptions from Jetty or other core components in openhab.log
  • OH refuses to start at all

The first step in debugging the problem is to clear the tmp and cache.

  1. Stop OH if it is running.

  2. Delete the contents of /var/lib/openhab2/cache and /var/lib/openhab2/tmp. For manual installations these folders are in your OH home folder under userdata. DO NOT DELETE THE FOLDERS THEMSELVES, JUST THE CONTENTS.

  3. Start OH.

  4. Watch openhab.log for errors, test if the problems persist. If so, search the forum and post a new thread if you do not find your solution.


Installing Javascript Transformation leads to "Internal Server Error"
Jetty update, Karaf 4.1.3 upgrade and full LSP support
Openhab2 not starting after reinstall
Insteonplm Binding - Ignored attempt to add duplicate port:
Astro Binding gets not initialized
Netatmo error HANDLER_CONFIGURATION_PENDING after update to OH 2.2 (from 2.1)
2.3.0 - wifiled/2.3.0 does not contain a manifest
Cannot get service reference for transformation service of type JSONPATH after update to openhab 2.3
After upgrade to OH2.3 zwave binding not working after upgrading
Rough start (lots of errors) on OpenHab 2.3 Release
Problems after upgrade to OH 2.3
Update to openhab 2.3 kinda broke everything
Yamaha Binding Problems
NTP and Yahoo Weather Bindings not working
[SOLVED] Lost most of my Things, can't add them back
Using non-deprecated functions with Pushover action
Rules stop executing after a while
mySQL: Connection is not valid!
[SOLVED] MQTT for SONOFF/TASMOTA this is difficult
Mi(Xiaomi) Smart home bindings?
MapDB creates errors
Hue Mystery bridge - endless loop
MQTT Binding Config - Where did I do that?
MODBUS binding works intermittently with WAGO 750-881 PLC
Endless errors after openhabian update today
OH 2.3 Snap 1224 = clear cache + tmp
Karaf console throws error when logging in and exits
[Solved] Artifact Issue on the Raspberry
Paper UI replies Error 500 - a lot
[Solved] Can no longer access any UI after upgrade
OH2.2 MQTT binding can't be used after changing password for Mosquitto broker
Problems with paperUI AND habmin
OpenHab MQTT Item Extra Publish
How to get my first rule running
Reset hue binding
Binding gets stopped w/o any obvious reason
Mqttitude failing with "no lat/lon configured for home" (but there is)
Upgrade has killed my install - desperate times
OH2.2 Crashing randomly
Mi(Xiaomi) Smart home bindings?
Weather bindings
Regular KNX Link Loss since upgrade to 2.2
Paper UI - Error 500: Internal Server Error
A URL must be configured for calendar ''
Menu extensions no visible in paper ui
Cannot select any items in HABPanel
Error resolving artifact org.jline:jline:jar:3.5.1-sp1?
Sitemaps are no longer working after upgrading from 2.0 to 2.1.0-1
How to setup things files?
New install of OH2 and Ubuntu - cannot get a sitemap displayed
Error 409 means uninstall?
Zwave and OH 2.3
WeatherUnderground binding fails to install
Can't update items via GUI?
Nibe uplink binding
REST API install problems
After openhabe 2.3 update, homematic binding don't update item status
UI does not load after restore 2.2 config on 2.3 release
Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)
After 2.3 Update most things gone
(Philipp) #2

Hi Rich,

thanks for the Thread.
Could you please help a noob like me with the commands ?

  1. Stop OH
sudo systemctl stop openhab2.service
  1. Delete the contents of /var/lib/openhab2/cache and /var/lib/openhab2/tmp. DO NOT DELETE THE FOLDERS THEMSELVES, JUST THE CONTENTS.
HOW TO DO THIS ? 
  1. Start OH.
cd /etc/init.d
sudo ./openhab2 start

dont want to break OH - Thanks


Karaf.Feature issues after update to 2.3
(pmc) #3

Stop OH / Start OH

Depends on the installation:

for example:
http://docs.openhab.org/installation/linux.html#service
start, restart, stop and retrieve status
sudo systemctl start openhab2.service
sudo systemctl restart openhab2.service
sudo systemctl stop openhab2.service
sudo systemctl status openhab2.service

for example
FTP Client: Log in with FTP Client, delete all subfolders and files from folders above
Samba Mount: Mount Fodlers via Samba (if enabled), delete all subfolders and files from folders above


Export Binding to Raspi
(Thomas Binder) #4

hi Philipp,

openHABian HowTo
if running OH2 on a Debian like Linux (openHABian being one of those), it’s done like this:

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

note:

  • If you installed OH2 manually (e.g. not with openHABian), the cache and tmp folders are located in another place, but you will know (as then you’re supposedly an expert).
  • if running OH2 in another OS as Debian, the OH2 Service ist stopped and started differently and the folders for cache and tmp are in a different place (again: then you’re supposedly an expert and know how and where),

[velux] New OpenHAB2 binding - feedback welcome!
Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)
Ubiquiti Unifi Binding Feature Discussion
(Philipp) #5

Thank you!


(walwe) #6

Is there any information available that explains / documents the bug(s) that require a manual deletion of tmp & cache?

The implications of randomly requiring a manual deletion of tmp & cache are dramatic when trying to automatically update OH as it will sometimes brick it. Deleting the cache & tmp on every update also seems to be troublesome as this requires re-downloading dependencies (bundles) that are stored in cache, which from my experience is also not very reliable and will lead (on first start after deletion) to a fast number of NotFound exceptions, thus forcing a second restart.


(Kim Skatun) #7

Is cache the same that is stored in the xml/java database? I had some issues that i had 2 entries for mqtt binding etc… when I checked in the karaf console. Is there a way to clear out all info in that cache/Db so it reloads it from the .cfg .items .rules .things file?


(Rich Koshak) #8

You can search the forum. But whenever there is an error that seems to point to a corruption (e.g. 500 errors, screen saying to wait while UIs are installed never goes away, add-ons refuse to be installed or uninstalled) that corruption would be in the cache and tmp. This is why that is one of the first recommendations for people to try. Their system is already broken, clearing the cache will not make it any worse.

There is even a command line option you can provide to cause karaf to do this on its own every time it starts for you, so it isn’t really that big of a deal. It will lead to longer startup times but shouldn’t cause any further problems. I don’t recommend doing that unless you find that you need to clear the cache every time you restart OH.

Absolutely and positively not. Only Things and Items and such created using PaperUI go in the JSONDB.

The proper solution there is to remove one of them using console commands. See http://docs.openhab.org/administration/index.html

It depends on how you have your system set up. If you have used PaperUI for ANYTHING then you need to tread carefully.


(Marcel) #9

Hey @rlkoshak,

thanks for this input, it helped me getting my avmfritz binding working again!

Question:
After deleting those folder contents, I did notice the following things

  • All my Bindings where gone!
  • All my Actions where gone!
  • All my Persistence items where gone!
  • Misc, Transformations and User Interfaces where still there!

It was not really a big deal but if I had known that something would be missing,
I would have created a short list with the bindings I had installed :slight_smile:.

Do you know if this behaviour is correct in OH 2.2.0, and why?
[Openhabian 1.4 on Raspberry 3]

Best regards,
Marcel


(Rich Koshak) #10

When you clear the cache your add-ons should be reinstalled. If that didn’t happen then that is incorrect behavior but I can’t guess as to why that didn’t happen.

The steps I outline above are part of the standard steps that happen during all upgrades.


(shane kevin) #11

Hi @rlkoshak, thanks for the tuts, a non cache/tmp question, what is core file? This file located in /userdata root with about 274,552KB size(2.3snapshot #1225), can I also need to delete this core file when upgrading?
image

add1: I’ve deleted this core file and it seems nothing happen, system still running well, so I am confused, what exactly does this core file do and why so large? Thanks

add2: may I also ask you where to find the “changelog” when a snapshot image get pushed? I don’t see any changelog thing on https://openhab.ci.cloudbees.com/ or the docker github page. I can see the #1225 number is growing but how to see what exactly change comparing to prviously number? Thanks


(Rich Koshak) #12

A core file occurs when a program crashes hard work a segfault. I’m surprised to see one here. It is late because it contains everything in ram at the time of the segfault. Had OH ever just inexplicably stopped?

There is no changed log for the snapshot. The snapshot is intended for the devs and for those who are good at debugging problems and consist of the result of the nightly builds. There is no release process beyond the nightly build succeeding. You can watch the prs on the various GitHub repos. Once a PR is merged it becomes party of the nightly build.


(shane kevin) #13

Nope, this is a brand new docker pull today, I never happen to see this core file ever, I docker pull the same image on rpi3,2,1 and x86 vm machine, never get that core file thing, and I think OH never accidently stop.
although there is one thing maybe related to this core file, is because I use a brand new sbc called NanoPi Duo to setup this openhab server(screenshot from that server), everything running so good but memory usage is go very high(435 of 512ram + 64 of 621zram, also running 10 containers in background, grafana,influx,mqtt,etc…), not sure if this is causing the core file thing created due to low mem…
so far so good still…


OpenHab not connecting to MQTT
(Ian Ward) #15

Oh, wow, thank you.
After ugrading to 2.3 on Ubuntu 16.04 LTS , the openhab mqqt binding stopped functioning.
This was critical for my mysensors network.
Clearing the cache refreshed the vital components that fixed the issues
Openhab2 began to react to mqqt inputs and publishing the openhab2 event bus to mqqt broker.


(Eric Einstein) #16

@rlkoshak, reading another (misguided) post, I did not heed your advice here and deleted the folders /var/lib/openhab2/cache and /var/lib/openhab2/tmp, not just their contents. Now my bundles aren’t starting among other issues. Is there any way to fix this without starting over??


(Angelos) #17

just recreate the folders and give them the correct ownership:

(sudo su)
mkdir /var/lib/openahab2/cache
mkdir /var/lib/openahab2/tmp
chown openhab:openhab /var/lib/openahab2/cache
chown openhab:openhab /var/lib/openahab2/tmp

(Eric Einstein) #18

Thanks. Actually, it did that automatically with 2.3. However the missing link was that I needed to reinstall the serial transport in the console. Hope this helps someone.


(Ray) #19

(post withdrawn by author, will be automatically deleted in 96 hours unless flagged)