Clear the Cache

Tags: #<Tag:0x00007f173a42baf0> #<Tag:0x00007f173a42b7d0>

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.

Installed OH

If you are running an installed OH (openHABian, installed using apt or yum):

  1. openhab-cli stop

  2. openhab-cli clean-cache

  3. openhab-cli start

  4. Watch openhablog for errors, test if the problems persist. If so, serach the forum and post a new thread if you do not find a solution. To get more information in openhab.log, use openhab-cli start --debug to enable debug logging.

Manual OH Install / Docker

  1. Stop OH if it is running.

  2. Delete the /var/lib/openhab2/cache and /var/lib/openhab2/tmp folders. For manual installations these folders are in your OH home folder under userdata.

  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 a solution. Log into the karaf console and enable debug logging to get more information about the errors.

EDIT: Reworked to use openhab-cli for installed OH and to delete the cache and tmp folders, not just their contents.

39 Likes
[SOLVED] Openhab2 not starting after reinstall
Jetty update, Karaf 4.1.3 upgrade and full LSP support
Installing Javascript Transformation leads to "Internal Server Error"
Insteonplm Binding - Ignored attempt to add duplicate port:
Netatmo error HANDLER_CONFIGURATION_PENDING after update to OH 2.2 (from 2.1)
Astro Binding gets not initialized
openHAB 2.5.x Patch Releases
Failed upgrading OpenHAB 2.4.0.002 to 2.5.2.000
Gardena Irrigation Control and Sensor in communication error while account is online
Windows 10: upgrading from 2.4 to 2.5.3: no charts, no connection to Homematic
Unhandled Exception: java.lang.NoClassDefFoundError: Could not initialize class
Neo Coolcam NAS-DS01Z does not work on OH 2.5
Openhab 2.5.3 - problems recently with switch items....going OFF after sending ON and vice-versa
S300TH binding problem since openHAB 2.5.3
[Solved] Rule - Timer - error reschedule not member of TimerImpl
Dispatching event to subscriber '(one of many)' takes more than 5000ms
Docker 2.5.0: Any suggestion fo rbest update practice
Xiaomi Mi Air Purifier (Xiaomi Mi IO)
[SOLVED] Update to 2.5.1 broke ZigBee (mismatched dependencies?)
[SOLVED] Weatherflow Smart Weather Station binding
2.5 issues after upgrade
[SOLVED] After update from 2.4.0 to 2.5.1 #11 habmin not working
[SOLVED] Influxdb persistence does not save constant values every Minute
AbstractManagedProvider: spurious log warning message
Issue with HomeMatic
[Solved] Cannot connect to OpenHAB dashboard on local network
[SOLVED] NEO Wallplug (NAS-WR01ZE) is in the database but is shown as Unknown Device
Habpanel not loading after upgrade to 2.5.0 Stable
Tahoma Binding compatible with OH2
Systematic un-installation of all bindings everytime I try to install a new one!
Influxdb connection refused on reboot
Constant "503 jersey not ready"
Paper UI incomplete on fresh install - unable to create items
Design Pattern: Expire Binding Based Timers
OpenHAB will not restart after clearing cache
[SOLVED] Mosquitto MQTT cannot get service to run
Squeezebox configuration
openHAB Milestone builds
ZWave Binding (2.4 and 2.5M3) appears to provoke severe latency with Aeotec G5 Z-Stick after rebuild
Enocean thing removal causes NPE
Upgrade Procedure for Windows on OH 2.5M2 and Beyond
Adding Parameters to Aeotec Nano Dimmer
Congrats 2.5.0.M2
Default page and Paper UI won't load
Amazonechocontrol binding not able to control echo device
Multiple item and rule files
Which is the best order to delete items, channels, things?
[SOLVED] Openhabian restore a backup to the latest restore the binding version too
Astro Binding Offset not working
Snapshot going back to old version: Failed installing Unable to resolve openhab-io-javasound/2.5.0.SNAPSHOT
[SOLVED] Openhab android app sends commands after delay of 10-20 seconds
[SOLVED] Bundle-Handling with openhabian
OpenHAB 2.4 MQTT beginner experience *principal conclusions* from a post-newbie
Serious issue - Bindings wont start after clearing cache and tmp
Openhab works slow, CPU of the RPI is high
KNX Integration & Alexa
How can I clean-up log messages
Official Google Assistant Integration for openHAB
Troubleshooting CalDav Personal - Public Garbage Collection Calendar
Astro:sun:night#start channel UNDEF and others too
[SOLVED] OPENHAB2 SNAPSHOT 2.5 #1595 fully broken?
[SOLVED] Hue Binding: Download failure
No access to OH, only Basic UI
FGDW002 Fibaro Door Window Sensor 2: no data
Can't connect to http://myip:8080
No network after reboot
Is OpenHab Dying?
[Reopend] Z-Wave Binding not working + Fibaro Wallplug FGWP102 shows as unknown device
[SOLVED] Things lost from PaperUi
BE469ZP zwave listed as unknown
HomeKit Binding cannot be installed
Manually add a thing (code)
How to restore or rebuild Openhabian and loose as little as possible
How to restore or rebuild Openhabian and loose as little as possible
Cannot include MS-P220 Dimmer
[SOLVED] OH does not start after upgrade to 2.5.0 S1560
[SOLVED] Openhab 2.5.0M1 keeps trying to install yahoo binding
UI and version.properties version mismatch after update on Synology
Ubiquiti Unifi Binding Feature Discussion
Strange add-ons behaviour on Rpi 3B+
HABPanel not working after moving to 2.5.0 Snapshot
Openhab totally messed up after restart: Xiaomi Door Sensors are opening by itself
HTML binding with json
OpenHAB Not installing Bindings or Transformations
No log entry in OpenHab.log (Raspberrypi 3+)
Openhab 2.3 with KNX2 Binding reacts very slow
Warning in my logs every 10 seconds?
Upgrade to 2.4, Bindings not showing in PaperUI
[SOLVED] Switching Graph for different Periods
[SOLVED] Dispatching event to subscriber '...' takes more than 5000ms
No log entry in OpenHab.log (Raspberrypi 3+)
OpenHab Fails at Start up with Eclipse Error
Rule Tab gone in Paper UI
Systeminfo [ERROR] No information for channel battery#remainingCapacity with device intex 0 :
[SOLVED] Plenty java errors in log file
No bindings installable at OH 2.4
[SOLVED] After update to OH 2.4 - Fibaro Roller Shutter 2 doesn't send command / scene IDs
[SOLVED] [HUE] Paper UI added Hue motion sensor without light sensor
[SOLVED] How to delete redundant Homematic bindings
My Openhab - Jetty Request Failed: null
Unknown zigbee device, cant delete from inbox
How can I reset the Z-wave binding and start over
My Rollershutter is not working
My Rollershutter is not working
[SOLVED] MQTT 2.4 setup problem - mix of GUI/textfile configuration problem
SRT321 identified as SRT323
[SOLVED] After upgrade to 2.4 stable I'm flooded with java.lang.IllegalStateException
Error 500 and 503 after ver2.4 upgrade
Convert from exec1 to exec2 binding - exec2 binding error when installed
Openhab crash after updated to 2.4
[SOLVED] Mysql setup
OH2 is looking for not installed bundle
[SOLVED] Karaf error when starting openhab2 on rpi3
[SOLVED] Karaf error when starting openhab2 on rpi3
Avmfritz Binding - Getting warnings on existing channels and things on startup [Solved]
Avmfritz Binding - Getting warnings on existing channels and things on startup [Solved]
[SOLVED] Issues after update to version 2.4.0
Sonos Ghosts won't go away
[SOLVED] Mapdb throwing errors, any idea?
[SOLVED] Site Maps Not found after reboot in 2.4
New Docker Upgrade Ability
[SOLVED] System freezes every 1 minute
Telegram: connection refused
ZWave Dual Paddle displays as Single
[SOLVED] Xiaomi Mi Smart Home Binding - gateway problem
New Jeelink Openhab2 Binding
[Latest Snapshot]: Connection refused
Seneye Binding
[OH 2.4.0 M7] Testing Results
[SOLVED] [HELP] MySQL persistence not populating my database
Google TTS addon for OH2
Google TTS addon for OH2
WARN message every second: RetrieveRemoteDescriptors - Device descriptor retrieval failed
Homematic CCU3 connection issues - COMMUNICATION_ERROR Unknown XML-RPC tag: title
[OH 2.4.0 M6] Testing Results
How to recover from Java Exceptions showing strings not included in config?
Try to Modify zwave binding and install new JAR in the addons directory (that fails gnu.io can not be resolved)
[SOLVED] Innogy binding RST - "handler was already disposed."
KNX does not work anymore with my items
HowTo: Use Philips Hue sensors (Motion Sensor / Dimmer Switch)
Installation went wrong
Everything lost? No PaperUI etc :-(
WiFI LED Binding error won't let OpenHAB UI start
MagentaTV Binding for Deutsche Telekom MR 4xx
Installation or deinstallation of Bindings Error
Sitemap Weirdness
ERROR HTTP 500 - Sitemap default could not be found
Tellstick binding 2.4.0-SNAPSHOT not working
Dash button rule doesn't run
OPENHABIAN doesn´t show MQTT Temp
Error 404 when trying to add Discovered Z-Wave Thing
Ghost device
NZW30S from Inovelli not a recognized Z-Wave device
[SOLVED] Astro binding throws XML parsing error at initialization
HTTP ERROR 404 (PaperUI, ClassicUI)
OpenHabian Raspi3 Bootloop
HTTP ERROR 404 (PaperUI, ClassicUI)
HTTP ERROR 404 (PaperUI, ClassicUI)
GPSTracker with Life360, OwnTracks and GPSLogger integration
Help installing binding - Could not resolve module
[SOLVED] HarmonyHub: NPE when starting activity
[SOLVED] Update to 2.3.0 failed
ZWave Wrong identification of manufacturer / model of Door / Window sensor
[SOLVED] MQTT for SONOFF/TASMOTA this is difficult
Screwed my OpenHab 2.2.0
Updating from 2.1,0-1
MQTT binding in waiting status
New binding: Isy
I sort of want to start over
Mqtt binding stops unexpectedly
Inbox broke - Error 500 after installing KODI binding
Impossible to delete chromecast thing
Switching and dimming DMX light with a KNX wall switch
After reinstall sonos does not work
BasicUI gives Server Error 500 after a few hours
Yeelight binding issue (2.4.0, 2.3.0), few channels than before and can't find items
Updating Openhab 2.3.0 to 2.4.0-SNAPSHOT issue on Mac OS
Octoprint, MQTT, and JSONPATH
[SOLVED] Javascript Transformation Error with MQTT
Does open hab require raspberry pie or any other device to operate?
Eclipse Issue after upgrade to OH 2.3 - 8080 not reachable any longer
Cron based rules still executing at old time in spite of changes
HABmin, zwave things, items, and dashboards
REST API error
[SOLVED] Ghost item
After upgrade 2.2.0-1 (Stable) to 2.3.0-1 (Stable) & iOS (11.4.1) App: ServerRuntime$Responder - I/O error when closing the app
Astro binding throwing exceptions for moon since 00:00 this morning
OpenHab 2.3 not working with Wemo
[SOLVED] Still some log presents
RRD4J item store problem
KNX Binding needs daily reinstall
Emerson Sensi Thermostat
Problem with knx binding after update
Failed installing 'openhab-misc-myopenhab'
Problems with Z-wave after update to 2.3.0
Current travel time on favorit route
OH2 Z-Wave refactoring and testing... and SECURITY
[SOLVED] OpenHab MQTT binding install - takes forever and does not install
Dashboard problem (LAN access) openhab 2.3.0 on CentOS
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
Release Candidate and Support: Amazon Echo Control Binding
After 2.3 Update most things gone
2.3.0 - wifiled/2.3.0 does not contain a manifest
[SOLVED] 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] After restoring last backup no connection to dashboard possible
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
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
[SOLVED] 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
[Solved] Can no longer access any UI after upgrade
OH3 Smartthings Add-on Discovery not working
[fronius] How to get the daily total energy consumption and grid import/export?
Migrated to OH3 - Rules Page won't load
Homematic binding OH3- Buffering capacity 2097152 exceeded
[Solved] OH3: How to get rid of old bindings?
Cannot update any binding/bundles from 2.5.7 to 2.5.10
Add binding option is gone :(
Can't remove Things from Tesla Binding
Openhab2.service - openHAB 2 - empowering the smart home
Manually add a thing (code)
Complete failure to install add-ons / bindings / extensions after upgrade to 2.5.8
Tahoma Binding compatible with OH2
Rule Engine (Experimental) Installed but No Button/Menu in PaperUI
OH constantly creates new threads and runs out of memory
Possible cause for OutOfMemoryError? (+many other irrelevant complaints)
Installing Javascript Transformation leads to "Internal Server Error"
Update causes java error and PaperUI in offline

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

1 Like

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

2 Likes

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),
12 Likes

Thank you!

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.

1 Like

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?

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.

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

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.

1 Like

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

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.

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…

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.

@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??

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
1 Like

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.

I followed this thread and deleted files in cache and tmp because things were just going bonkers. Now Paper UI is gone, all I have are homebuilder, logviewer, and help. I didn’t have a backup, but I do have the items files, which is where I spent most of my time. What is my best course of action now?

Edit addons.cfg to install PaperUI and your other needed bindings.

Could you elaborate a little more? Stating “edit” means nothing.