Clear the Cache

I think you can just uninstall the binding and then install it again, (the Unifi binding is manual install as far as I remember).

Clearing the cache seems to be very dangerous :confused:
I have a setup running in docker. All configuration in text files. After clearing the cache (had problem with timer/quartz in rules ) OH can not start.
Tried removing all conf files to prevent errors from rules, did many restarts and more clearing the cache and always the same behaviour. It seems that, now i need to remove ALL files, and start from beginning and one more time install all bindings via PaperUI. Nevertheless such situation is VERY disturbing and keeping config in files saves me tons of work


==> /logs/openhab.log <==

2020-09-22 14:40:54.106 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Warsaw'.

2020-09-22 14:40:54.114 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'pl_PL'.

2020-09-22 14:40:54.921 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.2.xxx:8181

2020-09-22 14:40:54.922 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.2.xxx:8993

2020-09-22 14:40:55.230 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

==> /logs/events.log <==

2020-09-22 14:40:57.951 [thome.event.ExtensionEvent] - Extension 'package-expert' has been installed.

==> /logs/openhab.log <==

2020-09-22 14:43:27.372 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-exec, openhab-binding-airquality, openhab-persistence-influxdb, openhab-ui-habpanel, openhab-ui-restdocs, openhab-binding-mqtt, openhab-transformation-map, openhab-binding-onewire, openhab-ui-classic, openhab-binding-caldav-personal1, openhab-ui-habmin, openhab-transformation-xslt, openhab-binding-homematic, openhab-transformation-exec, openhab-ui-paper, openhab-transformation-scale, openhab-binding-samsungtv, openhab-binding-modbus, openhab-binding-networkupstools, openhab-misc-market, openhab-binding-mail, openhab-transformation-javascript, openhab-binding-caldav-command1, openhab-binding-plex1, openhab-transformation-regex, openhab-transformation-jsonpath, openhab-binding-zwave, openhab-binding-mihome, openhab-transformation-xpath, openhab-persistence-rrd4j, openhab-ui-basic, openhab-binding-astro, openhab-binding-unifi, openhab-binding-melcloud, openhab-binding-onkyo, openhab-binding-snmp': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-modbus; type=karaf.feature; version="[2.5.8,2.5.8]"; filter:="(&(osgi.identity=openhab-binding-modbus)(type=karaf.feature)(version>=2.5.8)(version<=2.5.8))" [caused by: Unable to resolve openhab-binding-modbus/2.5.8: missing requirement [openhab-binding-modbus/2.5.8] osgi.identity; osgi.identity=org.openhab.binding.modbus.sunspec; type=osgi.bundle; version="[2.5.9,2.5.9]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.modbus.sunspec/2.5.9: missing requirement [org.openhab.binding.modbus.sunspec/2.5.9] osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.modbus.discovery)" [caused by: Unable to resolve org.openhab.binding.modbus/2.5.9: missing requirement [org.openhab.binding.modbus/2.5.9] osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.io.transport.modbus.endpoint)" [caused by: Unable to resolve org.openhab.io.transport.modbus/2.5.9: missing requirement [org.openhab.io.transport.modbus/2.5.9] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.commons.pool2)(version>=2.8.0)(!(version>=3.0.0)))"]]]]

Clearing the cache is basically removing the stuff that openHAB has downloaded and installed/changed on it’s own.

Clearing the cache happens at every upgrade so that the new version of bindings can be installed.

Clearing the cache should only be done to solve certain specific problems. It’s not a cure all and it’s not something that should be done as a first choice to solve all problems.

What sort of problem? There is nothing about clearing the cache that would even touch Timers. Quartz, the thread pools, and rules are all implemented by the core. They do not come out of the cache. Clearing the cache should never be done to try and fix any such errors.

There is a known problem after clearing the cache that impacts a few users where after clearing the cache openHAB simply does not recognize that a bunch of your Items exist. You’ll see lots of “no such Item” errors and the like. The solution is to wait for OH to come up, then restart. I’ve only ever had to restart once but some have reported up to three restarts.

Removing the config files similarly would not address the problem, only mask it. When you are having problems, errors are a good thing. They give you the knowledge necessary to understand what is going wrong.

@rlkoshak thank you for your reply. Since i have read this topic i thought that clearing the cache can solve most of the problems and errors which seems weird. Now its clear for me that its not best way of thinking :slight_smile:

To clarify, before clearing the cache i had this sort of error:

[ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.1.2.1::1::/0' failed.

I thought that clearing the cache MAY help so decided to do that.

I encountered such a situation and to have logs more clear just removed all my things,items,rules and so on (conf directory) . That’s why there is only few positions in the logs.
After googling to solve my problems i found a lot topic with similar error:

[ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing "some bindings"

Now, to have lessons learned and before i start from the beginning with clear OH and installing all bindngs once again, do you have any hints how can i try to recover actual installation ?

The only error you have in the log in you original post is failure to install some bindings, the source of which appears to be realted to the modbus binding.

If you are using /etc/openhab2/service/addons.cfg to manage your addons, remove modbus from the list and see if the rest can now install. If not, stop openHAB and edit /var/lib/openhab2/config/org/openhab/addons.config to remove the modbus binding.

NOTE: errors having to do with the installation and removal of bindings are one of those types of errors that can be solved by clearing the cache. So if the above doesn’t help, try one more clearing of the cache and see if that fixes things.

Removing modbus binding from addons.config solved the problem and OH installed all required bindings :slight_smile: Thank you for help and explanation.

Hi,

can i somehow skip the y/n prompt here?

root@openhab3:~# openhab-cli clean-cache -y

This command will delete the temporary files within openHAB.
May resolve issues with addon installation and configuration.
The next start of openHAB will take a bit longer.

Okay to Continue? [y/N]:

I tried -y but it does not work.

Thanks in advance,
Alex

You can use:

echo "y" | openhab-cli clean-cache

However - I’m curious as to why you would want to, or why you might need it? The warning is there because it shouldn’t need to be used often.

1 Like

It’s been a while but I just had the same issue again in OH 3.4.1 - fortunately I found this old thread of mine and remebered the fix.
My installation is ancient and my temp and cache is in /opt/openhab/userdata/
But again this fixed did work flawlessly. So in case the openhab-cli clean-cache does not work for you - you can still do the manual clean.
All my bindings were restored too