Clear the Cache

As far as I remember, when you do an upgrade from within openhabian.config, it will clear cache and tmp in the upgrade process automaticly.

Strictly speaking no, but it is included with the install/upgrade scripts to come with the openhab2 package. Which is what openhabian is calling if you select option 03.

Just to provide a bit of clarity.

  1. Apt and yum updates to openHAB will always clear the cache and tmp as part of the upgrade process.
  2. openHABian installs openHAB via apt so see 1.
  3. The Docker image will always clear the cache and tmp folders if the container is running a different version of OH from the version of the files mounted to userdata.
  4. When updating a manually installed OH, you must clear the cache and tmp manually which is clearly documented in the instructions.

Therefore, if 4 doesn’t apply to you, the only time you should clear the cache and tmp folders is if you are seeing errors that indicate a reinstall of the add-ons might fix.

2 Likes

Perfect!! Already copied to my “HOW TO” document.
Thanks a million.

Hello
I have a problem
after a new installation

#
#############################################################################
##        Ip = 192.168.0.222
##   Release = Raspbian GNU/Linux 10 (buster)
##    Kernel = Linux 4.19.97-v7l+
##  Platform = none
##    Uptime = 1 day(s). 4:20:32
## CPU Usage = 27.75% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 1.15, 5m: 1.14, 15m: 1.11
##    Memory = Free: 2.57GB (67%), Used: 1.28GB (33%), Total: 3.86GB
##      Swap = Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
##      Root = Free: 53.39GB (95%), Used: 2.51GB (5%), Total: 58.30GB
##   Updates = 0 apt updates available.
##  Sessions = 1 session(s)
## Processes = 143 running processes of 32768 maximum processes
#############################################################################

              Welcome to            __  _____    ____  _
            ____  ____  ___  ____  / / / /   |  / __ )(_)___ _____
           / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  / / __ `/ __ \
          / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ / / /_/ / / / /
          \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/_/\__,_/_/ /_/
              /_/
                  openHAB 2.5.3-1 (Release Build)

I passed the files

# The installation package of this openHAB instance

# Note: This is only regarded at the VERY FIRST START of openHAB

# Note: If you want to specify your add-ons yourself through entries below, set the package to "minimal"

# as otherwise your definition might be in conflict with what the installation package defines.

#

# Optional. If not set, the dashboard (https://<yourserver>:8080/) will ask you to choose a package.

#

# Valid options:

#   - minimal  : Installation only with dashboard, but no UIs or other add-ons. Use this for custom setups.

#   - simple   : Setup for using openHAB purely through UIs - you need to expect MANY constraints in functionality!

#   - standard : Default setup for normal users, best for textual setup

#   - expert   : Setup for expert users, especially for people migrating from openHAB 1.x

#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.

#

# See https://www.openhab.org/docs/configuration/packages.html for a detailed explanation of these packages.

#

package = minimal

# Access Remote Add-on Repository

# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.

# This not only makes latest snapshots of add-ons available, it is also required for the installation of

# any legacy 1.x add-on. (default is true)

#

remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is 

# already a 2.x version available (requires remote repo access, see above). (default is false)

#

legacy = false

# A comma-separated list of bindings to install (e.g. "binding = sonos,knx,zwave")

binding = zwave,deconz,shelly,squeezebox,expire1,amazonechocontrol,harmonyhub,hue,plex1,ntp,astro,mqtt,http1,network,systeminfo,weather1,telegram,dscalarm,gpstracker,exec

# dmx,bluetooth

# A comma-separated list of UIs to install (e.g. "ui = basic,paper")

ui = basic,dashboard,habmin,habot,habpanel,homebuilder,paper

# A comma-separated list of persistence services to install (e.g. "persistence = rrd4j,jpa")

#persistence = rrd4j,mapdb,influxdb

# A comma-separated list of actions to install (e.g. "action = mail,pushover")

action = telegram,pushover

# mail

# A comma-separated list of transformation services to install (e.g. "transformation = map,jsonpath")

transformation = map,regex,xslt,exec,javascript,scale,xpath,jsonpath

# A comma-separated list of voice services to install (e.g. "voice = marytts,freetts")

#voice = 

# A comma-separated list of miscellaneous services to install (e.g. "misc = myopenhab")

misc = market,openhabcloud,hueemulation,ruleengine,gcal1

and Things file

the problem is when I do a clear the cache

step 1
sudo systemctl stop openhab2
step 2
sudo openhab-cli clean-cache
step 3
sudo systemctl start openhab2

when you started openhab
not working TimeOfDay
and I have to restart
restart server :
sudo systemctl restart openhab2.service
what i have to do to do it right

thanks

log viewer:

tail -f /var/log/openhab2/openhab.log /var/log/openhab2/events.log

2020-03-22 15:20:33.387 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘HEATING CONTROL AUTO MANUAL MODE’: The name ‘Temperature_Range’ cannot be resolved to an item or type; line 80, column 39, length 17
2020-03-22 15:20:17.123 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘watt My home energy’: For input string: “530.420 W”

2020-03-22 15:20:17.124 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘watt Kichent energy’: For input string: “4.790 W”

2020-03-22 15:20:17.126 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Microwave energy’: For input string: “1.780 W”

2020-03-22 15:20:17.138 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘HEATING CONTROL AUTO MANUAL MODE’: The name ‘Temperature_Range’ cannot be resolved to an item or type; line 80, column 39, length 17

2020-03-22 15:20:17.144 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Boiler Consumption State Machine (Extended)’: The name ‘Boiler_OpState’ cannot be resolved to an item or type; line 420, column 45, length 14

2020-03-22 15:20:17.149 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Total Amper home’: The name ‘Kitchen_Power’ cannot be resolved to an item or type; line 35, column 44, le

by restarting I get this problem
and they don’t show me Sonoff.things
mqtt broker online
restart server :
sudo systemctl restart openhab2.service

==> /var/log/openhab2/openhab.log <==

2020-03-22 16:09:56.790 [ERROR] [ersey.server.ServerRuntime$Responder] - An I/O error has occurred while writing a response message entity to the container output stream.

org.glassfish.jersey.server.internal.process.MappableException: org.eclipse.jetty.io.EofException

	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92) ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130) ~[bundleFile:?]

	at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711) [bundleFile:?]

	at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444) [bundleFile:?]

	at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434) [bundleFile:?]

	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329) [bundleFile:?]

	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [bundleFile:?]

	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [bundleFile:?]

	at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [bundleFile:?]

	at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [bundleFile:?]

	at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [bundleFile:?]

	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [bundleFile:?]

	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [bundleFile:?]

	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [bundleFile:?]

	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [bundleFile:?]

	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [bundleFile:?]

	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [bundleFile:?]

	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [bundleFile:?]

	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [bundleFile:?]

	at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [bundleFile:?]

	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Caused by: org.eclipse.jetty.io.EofException

	at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:283) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:818) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:549) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:857) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:929) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:250) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:226) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:525) ~[bundleFile:9.4.20.v20190813]

	at org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.write(ResponseWriter.java:325) ~[?:?]

	at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:229) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:116) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo(AbstractMessageReaderWriterProvider.java:79) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:105) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:60) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

	at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106) ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86) ~[?:?]

	... 53 more

Caused by: java.io.IOException: Broken pipe

	at sun.nio.ch.FileDispatcherImpl.writev0(Native Method) ~[?:1.8.0_222]

	at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51) ~[?:1.8.0_222]

	at sun.nio.ch.IOUtil.write(IOUtil.java:148) ~[?:1.8.0_222]

	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504) ~[?:1.8.0_222]

	at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:263) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:818) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:549) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:857) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:929) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:250) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:226) ~[bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:525) ~[bundleFile:9.4.20.v20190813]

	at org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.write(ResponseWriter.java:325) ~[?:?]

	at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:229) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:116) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo(AbstractMessageReaderWriterProvider.java:79) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:105) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:60) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) ~[bundleFile:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

	at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106) ~[?:?]

	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[bundleFile:?]

	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86) ~[?:?]

	... 53 more
1 Like

@jcosta46
this is because the rules are executed before all items are initialized. you can prevent this by adding a prestart routine or you just ignore the errors on startup and wait until all is settled down. if the errors only occur during startup they can be ignored.

thanks @HaKuNa
you could help me with that

#!/bin/sh
mv `\ls -1 /opt/openhab2/conf/rules/*.rules | grep -v Startup.rules` /opt/openhab2/conf/rules/prestart
echo
echo Launching the openHAB runtime...

DIRNAME=`dirname "$0"`
exec "${DIRNAME}/runtime/bin/karaf" "${@}"

this is rules file

rule "Alert: System started"
when
    System started
then
    Thread::sleep(30000)
    executeCommandLine("/bin/sh@@-c@@mv /opt/openhab2/conf/rules/prestart/*.rules /opt/openhab2/conf/rules",10000)
    logInfo("Rules", "Startup: Rules restored")
end

winSCP
/usr/share/openhab2/start.sh
my file
#!/bin/sh

echo Launching the openHAB runtime...

if [ ! -z ${OPENHAB_RUNTIME} ]; then
    RUNTIME=${OPENHAB_RUNTIME}
else
    RUNTIME="`dirname "$0"`/runtime"
fi

exec "${RUNTIME}/bin/karaf" "${@}"

I should add that and delete My file ?

#!/bin/sh
mv `\ls -1 /opt/openhab2/conf/rules/*.rules | grep -v Startup.rules` /opt/openhab2/conf/rules/prestart
echo
echo Launching the openHAB runtime...

DIRNAME=`dirname "$0"`
exec "${DIRNAME}/runtime/bin/karaf" "${@}"

please go through the linked thread. i will not mix different topics here.

sudo openhab-cli reset-ownership

Dear Colleagues,

i’m almost new in OH, may you help me to understand if is there a way to clean cache and tmp files for an spicific binding and not all openhab-cli clean cache? I mean clean cache from unifi binding that time to time brokes and after we got it cache clear it back to work…

1 Like

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…