Bundles in waiting state after 3.3.0.M4 update

  • Platform information:
    • Hardware: Raspberry PI4
    • OS: Linux 5.10.103-v7l+ armv7l GNU/Linux
    • Java Runtime Environment: OpenJDK Runtime Environment (build 11.0.14+9-post-Raspbian-1deb10u1)
    • openHAB version: 3.3.0.M4
      I have several java errors in log after update to 3.3.0.M4, referring to missing modules:

grep ‘Could not resolve’ openhab.log

org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.addon.marketplace [149]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.addon.marketplace.karaf [150]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.automation.module.media [155]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.automation.module.script [156]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.automation.module.script.rulesupport [157]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.automation.rest [158]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.io.monitor [172]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.lsp [191]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.rule [195]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.rule.ide [196]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.rule.runtime [197]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.script.ide [199]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.core.model.script.runtime [200]
org.osgi.framework.BundleException: Could not resolve module: org.openhab.io.openhabcloud [275]

In console I have all the budles installed but some are waiting:
openhab> bundle:list | grep -i waiting
283 │ Waiting │ 80 │ 3.3.0.M4 │ openHAB Core :: Bundles :: Automation
284 │ Waiting │ 80 │ 3.3.0.M4 │ openHAB Core :: Bundles :: Ephemeris
285 │ Waiting │ 80 │ 3.3.0.M4 │ openHAB Core :: Bundles :: Model Script

I tried to uninstall them, clean cache and restart, but still same errors

Can you please show the full log message? And for the bundles in waiting state: Please show

diag 283
diag 284
diag 285

openhab.log (55.2 KB)

openhab> diag 283
openHAB Core :: Bundles :: Automation (283)

Status: Waiting
Declarative Services
org.openhab.core.automation.thingsupport.AnnotatedThingActionModuleTypeProvider (336)
org.openhab.core.automation.internal.provider.i18n.ModuleTypeI18nServiceImpl (333)
org.openhab.core.automation.internal.parser.gson.ModuleTypeGSONParser (325)
org.openhab.core.automation.internal.template.RuleTemplateRegistry (334)
org.openhab.core.automation.internal.provider.file.ModuleTypeFileProviderWatcher (331)
org.openhab.core.automation.internal.provider.TemplateResourceBundleProvider (330)
org.openhab.core.automation.internal.commands.AutomationCommandsPluggable (320)
org.openhab.core.automation.internal.provider.AutomationResourceBundlesTracker (328)
org.openhab.core.automation.internal.RuleEventFactory (318)
org.openhab.core.automation.internal.module.factory.EphemerisModuleHandlerFactory (322)
org.openhab.core.automation.ManagedRuleProvider (316)
org.openhab.core.automation.internal.parser.gson.RuleGSONParser (326)
org.openhab.core.automation.internal.type.ModuleTypeRegistryImpl (335)
org.openhab.core.automation.internal.RuleEngineImpl (317)
org.openhab.core.automation.internal.module.factory.CoreModuleHandlerFactory (321)
org.openhab.core.automation.internal.provider.file.TemplateFileProviderWatcher (332)
org.openhab.core.automation.internal.provider.ModuleTypeResourceBundleProvider (329)
org.openhab.core.automation.internal.module.provider.AnnotatedActionModuleTypeProvider (324)
org.openhab.core.automation.internal.module.handler.TimerModuleHandlerFactory (323)
org.openhab.core.automation.internal.RuleRegistryImpl (319)
org.openhab.core.automation.internal.parser.gson.TemplateGSONParser (327)

openhab> diag 284
openHAB Core :: Bundles :: Ephemeris (284)

Status: Waiting
Declarative Services
org.openhab.ephemeris (337)

openhab> diag 285
openHAB Core :: Bundles :: Model Script (285)

Status: Waiting
Declarative Services
org.openhab.core.model.script.internal.engine.action.EphemerisActionService (342)
org.openhab.core.model.script.internal.engine.action.SemanticsActionService (344)
org.openhab.core.model.script.jvmmodel.ScriptItemRefresher (348)
org.openhab.core.model.script.extension.ScriptEngineConsoleCommandExtension (339)
org.openhab.core.model.script.internal.engine.action.PersistenceActionService (343)
org.openhab.core.model.script.internal.engine.action.AudioActionService (341)
org.openhab.core.model.script.ScriptServiceUtil (338)
org.openhab.core.model.script.internal.RuleHumanLanguageInterpreter (340)
org.openhab.core.model.script.internal.engine.action.ThingActionService (345)
org.openhab.core.model.script.internal.engine.action.VoiceActionService (347)
org.openhab.core.model.script.internal.engine.action.TransformationActionService (346)

Do you have a ephemeris.cfg in conf/services? If so, please show that. Do you have a file userdata/config/org/openhab/ephemeris.config? If so, please show that.

I believe conf is /etc/openhab and userdata is /var/lib/openhab on openHABian, but I’m not 100% sure.

No, I have no ephemeris.conf, and I do not remember to have done it.
All my config is done via text files under /etc/openhab and I know quite well what I diid in the past.

This is ephemeris.config (done via UI):

:org.apache.felix.configadmin.revision:=L"471"
city="“Biella”"
country="“Italia”"
dayset-school=""(\ “MONDAY”,\ “TUESDAY”,\ “WEDNESDAY”,\ “THURSDAY”,\ “FRIDAY”,\ )""
dayset-weekend="(\ “(\ “SATURDAY”,\ “SUNDAY”,\ )”,\ )"
felix.fileinstall.filename=“file:/var/lib/openhab/etc/org.openhab.ephemeris.cfg”
region="“Piemonte”"
service.bundleLocation="?"
service.pid=“org.openhab.ephemeris”

EDIT: Downgraded to 3.3.0M3, I have the same errors. Maybe some of my files are corrupted? I tried to backup/restore the whole OH3 and cleared cache, but nothing changed.
Further investigations bring me to think that some of these errors are related to the use of android app when out of local network. When I connect from my smartphone with OH client, after less than a minute I have this error:
2022-05-05 12:29:31.500 [WARN ] [ache.cxf.phase.PhaseInterceptorChain] - Interceptor for {http://internal.karaf.core.openhab.org/}LoggerResource has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67) ~[bundleFile:3.4.5]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5]
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90) ~[bundleFile:3.4.5]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) ~[bundleFile:3.4.5]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:222) ~[bundleFile:3.4.5]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[bundleFile:3.1.0]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) ~[bundleFile:3.4.5]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.43.v20210629]
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.43.v20210629]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) ~[bundleFile:9.4.43.v20210629]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.43.v20210629]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:82) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) ~[bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.43.v20210629]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.43.v20210629]

How did you mange to configure that via UI? I can’t set other day sets in UI than “weekend”. My configuration looks like this:

:org.apache.felix.configadmin.revision:=L"2"
city="Gelsenkirchen"
country="de"
dayset-weekend=( \
  "MONDAY", \
  "SATURDAY", \
  "SUNDAY", \
)
region="nw"
service.pid="org.openhab.ephemeris"

I would suggest you stop openHAB, change the configuration like my example (i.e. remove the double quotes, remove the service.bundleLocation entry, increase the revision and start openHAB again.

I’ll provide a fix that prevents invalid configurations to prevent other services from starting.

Stopped OH, edited /var/lib/openhab/config/org/openhab/ephemeris.config.
Then updated to 3.3.0.M4 , restarted, same error, and the config is again wrong as before of editing.
It is reinstalled in wrong format after restarting OH. I see it has the time of restarting, while after my editing it has the current time of editing.

The wrong file comes from the statement
felix.fileinstall.filename=“file:/var/lib/openhab/etc/org.openhab.ephemeris.cfg”

I edited /var/lib/openhab/etc/org.openhab.ephemeris.cfg this way:

dayset-weekend = (
“( “SATURDAY”, “SUNDAY”, )”,
)
Then in UI deleted my city and country from ephemeris configuration, restarted OH and all is fine for first restart!
Then the files is corrupted again:
:org.apache.felix.configadmin.revision:=L"262"
country="“it”"
dayset-weekend="(\ “SATURDAY,\ SUNDAY”,\ )"
felix.fileinstall.filename=“file:/var/lib/openhab/etc/org.openhab.ephemeris.cfg”
service.pid=“org.openhab.ephemeris”

Solved!
Edit /var/lib/openhab/etc/org.openhab.ephemeris.cfg

dayset-weekend=SATURDAY,SUNDAY

This makes such a /var/lib/openhab/config/org/openhab/ephemeris.config after restart:

:org.apache.felix.configadmin.revision:=L"270"
dayset-weekend=“SATURDAY,SUNDAY”
felix.fileinstall.filename=“file:/var/lib/openhab/etc/org.openhab.ephemeris.cfg”
service.pid=“org.openhab.ephemeris”

No more errors and all bundles are active

1 Like

FTR: Fix EphemerisManager crashing on invalid configuration by J-N-K · Pull Request #2949 · openhab/openhab-core · GitHub

I been looking at this issue once again (I was hit by it in 2015 and 2022), turns out that there is a nasty bug in processing of configuration inputs. The .config file read as an array - using syntax dayset-weekend=[ "SATURDAY", "SUNDAY" ] is written back as a collection dayset-weekend=( "SATURDAY", "SUNDAY" ) which breaks processing of .config file due to a bug in Felix Utils (1.11.2) which are used by Felix Fileinstall. There are new releases of felix utils, but fileinstall got stuck for few years with old utils and still does not process properly updated file. See
https://issues.apache.org/jira/browse/FELIX-6687

Another point - ConfigMapper (in 3.x) and ConfigParser (in 4.x) does not handle arrays. The line:

covers only part of cases - either value can be an array or type could be an array. It can be determined through Class.isArray and managed through java.lang.reflect.Array.

I know that issue is solved on OH end now, but wanted to share my findings just in case if someone runs again into troubles with ephemeris configuration using arrays/collections.