OH 4.1.1 startup takes more than an hour

YES! Keep the list of the addons in conf/services/addons.cfg
To remove them: comment out the line
To add them back: uncomment

Installing them one by one via the UI is way too tedious.

Do you have either a second SD Card or a second Pi handy? I would:

  1. backup your configuration using openHABian
  2. load a vanilla openHABian on a new SD Card
  3. put that into (the second) pi4
  4. start it up
  5. first try to add all 21 bindings and reboot
  6. if ok: restore the backup via openHABian

if at some point not ok=> great, if not, try again, but instead slowly adding one binding after the other.

That only applies if you used file-based configuration in the first place… otherwise you have to either edit the jsonDB (if you know, what you’re doing!) or do it manually via UI.

Either…

  1. Via Main UI | Settings | Add-on Management | Show Advanced … but since you apparently never get to Main UI, probably you need to try option 2. below

  2. By adding entries in the ‘openHAB-userdata/config/org/openhab/addons.cfg’ file as follows…

suggestionFinderIp=B"false"
suggestionFinderMdns=B"false"
suggestionFinderUpnp=B"false"

The Upnp and Mdns finders are probably NOT the cause of your issue since they are event driven on separate threads and therefore cannot block the main thread.

The Ip finder uses timeouts on its ping requests, so in theory it should also not block your system (at least not for an hour or more). However a) if the addon.xml for any binding had bad syntax on its finder timeout element it may fall over, and/or b) we are also discussing making the Ip finder more concurrent – see this. => So can you please do the following…

  1. Please give the full list of all installed bindings which you have defined in your system. EDIT: currently the KNX binding is the only addon that would use the Ip finder.
  2. Try suggestionFinderIp=B"false" above and let us know the outcome.

Pinging @holgerf and @mherwege

Awesome, thanks!
Also suggestionFinderUsb=B"false" ?

I hope this will make its way to the official doc, if not already.

To get the current list of ALL installed addons (whether they were installed through UI or addons.cfg):

/path/to/userdata/config/org/openhab/addons.config

Just back up that file (copy it somewhere safe where it won’t get deleted, or copy paste it). It’s a plain text file with simple to understand syntax, basically almost identical to addons.cfg
While openhab is stopped (kill -9 if you have to), edit that file, remove the values after binding=, but leave the double quotes around, i.e. binding=""

Then rm -rf userdata/tmp/* userdata/cache/*

Also move everything inside your addons folder to a separate folder outside of it.

If you happen to use addons.cfg method of installing your bindings, comment out the corresponding lines too.

Then start openhab.
Voila - ALL bindings gone!

No. The Usb finder and resp. the Process finder look for hardware attached to, resp. processes running on, the local PC, so their scans are fast and without LAN involvement, so we deemed it not necessary to disable them.

I will check. EDIT: apparently ‘addons.cfg’ has absolutely no official doc for it. Or? So rather than just editing an existing file (which I could easily do), it would require creating a complete new page and linking it into the table of contents etc. => WDYT?

You should not directly edit this file in the userdata/config folder. Edit the addons.cfg file in the configuration folder services directory instead:

suggestionFinderIp=false
suggestionFinderMdns=false
suggestionFinderUpnp=false

@andrewfg Commented lines for this should be added to this file in the distro repo (with default true)

1 Like

I created a PR: Add suggestion finder parameters to addons.cfg by mherwege · Pull Request #1633 · openhab/openhab-distro · GitHub

Wanted to provide some settings:

EXTRA_JAVA_OPTS=“-Xms192m -Xmx768m”

Addons from addons.cfg:
binding=“mail,homematic,netatmo,systeminfo,tr064,telegram,amazonechocontrol,network,openweathermap,avmfritz,yamahareceiver,solarlog,gardena,astro,mqtt,squeezebox,hue,weatherunderground,zwave,exec,fmiweather”

Now I restarted openhab (without disabling any bindings), logged into karaf console and looked for bundle:list.
The result after 3 different bundle:list is here:
bundle_list.txt (60.5 KB)
It looks as if the Exec binding, the Exec transformation service and the JavaScript Scripting keeps waiting and does not become active.

I only have 2 items that use the Exec and/or JavaScript binding:

Number CPU_Uptime                 "CPU_Uptime [JS(uptime.js):%s]"                       <time>       { channel="systeminfo:computer:work:cpu#uptime" }

// Number type does not yet work for exec binding
// Do a transformation of openhab uptime secs to show uptime: 1 day 15 hours 32 mins instead of 2372 min:
String OpenHAB_Uptime             "OpenHAB uptime [JS(uptime_secs.js):%s]"              <time>       { channel="exec:command:uptime:output" }

I think I have this since openHAB 1.8 or at least since 2.4…

uptime_sh.txt (519 Bytes)

If you are in the console - diag command is your friend. It should show what Waiting bundles are actually wait for.

Also have a look at output of lde command while system is booting. It should show you last registered exception.

1 Like

Inside conf/services/addons.cfg

The syntax doesn’t need double quotes. It shouldlook like this

binding = mail,homematic,netatmo,systeminfo,tr064,telegram,amazonechocontrol,network,openweathermap,avmfritz,yamahareceiver,solarlog,gardena,astro,mqtt,squeezebox,hue,weatherunderground,zwave,exec,fmiweather

Don’t confuse that with this file userdata/config/org/openhab/addons.config

  • addons.cfg is for user to edit if you’re using file based config to install your add-ons
  • addons.config is openhab’s managed storage and should not be touched normally.

This seems too small. Have you tried to remove this setting?

Started OH again without changes and entered diag after approx 10 min from Karaf console:

openhab> diag
openHAB Core :: Bundles :: Automation (161)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.internal.provider.AutomationResourceBundlesTracker (86)
org.openhab.core.automation.ManagedRuleProvider (73)
org.openhab.core.automation.internal.RuleEngineImpl (75)
org.openhab.core.automation.internal.provider.file.ModuleTypeFileProviderWatcher (89)
  missing references: $000
org.openhab.core.automation.internal.RuleRegistryImpl (77)
org.openhab.core.automation.internal.parser.gson.TemplateGSONParser (85)
org.openhab.core.automation.thingsupport.AnnotatedThingActionModuleTypeProvider (94)
org.openhab.core.automation.internal.parser.gson.ModuleTypeGSONParser (83)
org.openhab.core.automation.internal.provider.TemplateResourceBundleProvider (88)
org.openhab.core.automation.internal.module.factory.EphemerisModuleHandlerFactory (80)
org.openhab.core.automation.internal.type.ModuleTypeRegistryImpl (93)
org.openhab.core.automation.internal.commands.AutomationCommandsPluggable (78)
org.openhab.core.automation.internal.provider.i18n.ModuleTypeI18nServiceImpl (91)
org.openhab.core.automation.internal.module.provider.AnnotatedActionModuleTypeProvider (82)
org.openhab.core.automation.internal.module.handler.TimerModuleHandlerFactory (81)
org.openhab.core.automation.events.AutomationEventFactory (74)
org.openhab.core.automation.internal.RuleEventFactory (76)
org.openhab.core.automation.internal.parser.gson.RuleGSONParser (84)
org.openhab.core.automation.internal.module.factory.CoreModuleHandlerFactory (79)
org.openhab.core.automation.internal.provider.ModuleTypeResourceBundleProvider (87)
org.openhab.core.automation.internal.provider.file.TemplateFileProviderWatcher (90)
  missing references: $000
org.openhab.core.automation.internal.template.RuleTemplateRegistry (92)


openHAB Core :: Bundles :: Automation Script RuleSupport (164)
--------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.module.script.rulesupport.internal.RuleSupportScriptExtension (111)
org.openhab.core.automation.module.script.rulesupport.internal.loader.DefaultScriptFileWatcher (115)
  missing references: $000
org.openhab.core.automation.module.script.rulesupport.shared.ScriptedRuleProvider (116)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleHandlerFactory (112)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedPrivateModuleHandlerFactory (114)
org.openhab.core.automation.module.script.rulesupport.internal.CacheScriptExtension (110)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleTypeProvider (113)


openHAB Core :: Bundles :: Configuration Dispatcher (171)
---------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.config.dispatch.internal.ConfigDispatcher (140)
org.openhab.core.config.dispatch.internal.ConfigDispatcherFileWatcher (141)
  missing references: $001


openHAB Core :: Bundles :: Model Core (195)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.core.internal.SafeEMFImpl (213)
org.openhab.core.model.core.internal.ModelRepositoryImpl (212)
org.openhab.core.folder (214)
  missing references: $002


openHAB Core :: Bundles :: Model YAML (215)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.yaml.internal.semantics.YamlSemanticTagProvider (244)
org.openhab.core.model.yaml.internal.YamlModelRepository (243)
  missing references: $000


openHAB Core :: Bundles :: Transformation Service (220)
-------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.transform.internal.TransformationRegistryImpl (296)
org.openhab.core.transform.FileTransformationProvider (293)
  missing references: $000
org.openhab.core.transform.ManagedTransformationProvider (294)
org.openhab.core.transform.TransformationHelper (295)


openHAB Add-ons :: Bundles :: Automation :: JavaScript Scripting (270)
----------------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.automation.jsscripting.internal.GraalJSScriptEngineFactory (324)
  missing references: $001
org.openhab.automation.jsscripting.internal.fs.watch.JSScriptFileWatcher (327)
  missing references: $000
org.openhab.automation.jsscripting.internal.scope.OSGiScriptExtensionProvider (328)
org.openhab.automation.jsscripting.internal.fs.watch.JSDependencyTracker (326)
  missing references: $000
org.openhab.automation.jsscripting.internal.JSScriptServiceUtil (325)


openHAB Add-ons :: Bundles :: Exec Binding (274)
------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.binding.exec.internal.ExecWhitelistWatchService (340)
  missing references: $000
org.openhab.binding.exec.internal.ExecHandlerFactory (339)
  missing references: $000


openHAB Add-ons :: Bundles :: Transformation Service :: Exec (310)
------------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.transform.exec.internal.ExecTransformationService (1)
  missing references: $000
org.openhab.transform.exec.internal.ExecTransformationWhitelistWatchService (2)
  missing references: $000
org.openhab.transform.exec.internal.profiles.ExecTransformationProfileFactory (3)
  missing references: TransformationService

lde command did not show anything.

So what to do now?

The following is just a thought. You have modules that are ‘Waiting’ in both openHAB Add-ons :: Bundles :: something and in openHAB Core :: Bundles :: something. I am guessing that there is some kind of thread-lock between the two sets of bundles. So my suggestion is to edit the addons.cfg and remove any of the openHAB Add-ons :: Bundles waiting modules, then restart your system and see if that releases the openHAB Core :: Bundles to start fully. Then add back the openHAB Add-ons :: Bundles one-by-one to see which one causes openHAB Core :: Bundles to block again.

Note: this is more-or-less the same as what others have suggested you to do, but just phrased in another way…

1 Like

Okay, so now I removed Exec binding, Exec Transformation, JavaScript, JSONPath Transformation, RegEx Transformation, Map Transformation.

addons.config:

:org.apache.felix.configadmin.revision:=L"47"
automation=""
binding="mail,homematic,netatmo,systeminfo,tr064,telegram,amazonechocontrol,network,openweathermap,avmfritz,yamahareceiver,solarlog,gardena,astro,mqtt,squeezebox,hue,weatherunderground,zwave,fmiweather"
misc="openhabcloud"
package="standard"
persistence="rrd4j,mapdb"
service.pid="org.openhab.addons"
suggestionFinderIp=B"false"
suggestionFinderMdns=B"false"
suggestionFinderUpnp=B"false"
transformation=""
ui="basic,habpanel"
voice=",marytts"

So no Transformation service any more.
However, Diag still reports a problem with Transformation:

openhab> diag
openHAB Core :: Bundles :: Automation (161)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.internal.provider.AutomationResourceBundlesTracker (77)
org.openhab.core.automation.ManagedRuleProvider (64)
org.openhab.core.automation.internal.RuleEngineImpl (66)
org.openhab.core.automation.internal.provider.file.ModuleTypeFileProviderWatcher (80)
  missing references: $000
org.openhab.core.automation.internal.RuleRegistryImpl (68)
org.openhab.core.automation.internal.parser.gson.TemplateGSONParser (76)
org.openhab.core.automation.thingsupport.AnnotatedThingActionModuleTypeProvider (85)
org.openhab.core.automation.internal.parser.gson.ModuleTypeGSONParser (74)
org.openhab.core.automation.internal.provider.TemplateResourceBundleProvider (79)
org.openhab.core.automation.internal.module.factory.EphemerisModuleHandlerFactory (71)
org.openhab.core.automation.internal.type.ModuleTypeRegistryImpl (84)
org.openhab.core.automation.internal.commands.AutomationCommandsPluggable (69)
org.openhab.core.automation.internal.provider.i18n.ModuleTypeI18nServiceImpl (82)
org.openhab.core.automation.internal.module.provider.AnnotatedActionModuleTypeProvider (73)
org.openhab.core.automation.internal.module.handler.TimerModuleHandlerFactory (72)
org.openhab.core.automation.events.AutomationEventFactory (65)
org.openhab.core.automation.internal.RuleEventFactory (67)
org.openhab.core.automation.internal.parser.gson.RuleGSONParser (75)
org.openhab.core.automation.internal.module.factory.CoreModuleHandlerFactory (70)
org.openhab.core.automation.internal.provider.ModuleTypeResourceBundleProvider (78)
org.openhab.core.automation.internal.provider.file.TemplateFileProviderWatcher (81)
  missing references: $000
org.openhab.core.automation.internal.template.RuleTemplateRegistry (83)


openHAB Core :: Bundles :: Automation Script RuleSupport (164)
--------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.module.script.rulesupport.internal.RuleSupportScriptExtension (102)
org.openhab.core.automation.module.script.rulesupport.internal.loader.DefaultScriptFileWatcher (106)
  missing references: $000
org.openhab.core.automation.module.script.rulesupport.shared.ScriptedRuleProvider (107)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleHandlerFactory (103)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedPrivateModuleHandlerFactory (105)
org.openhab.core.automation.module.script.rulesupport.internal.CacheScriptExtension (101)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleTypeProvider (104)


openHAB Core :: Bundles :: Configuration Dispatcher (171)
---------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.config.dispatch.internal.ConfigDispatcher (131)
org.openhab.core.config.dispatch.internal.ConfigDispatcherFileWatcher (132)
  missing references: $001


openHAB Core :: Bundles :: Model Core (195)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.core.internal.SafeEMFImpl (204)
org.openhab.core.model.core.internal.ModelRepositoryImpl (203)
org.openhab.core.folder (205)
  missing references: $002


openHAB Core :: Bundles :: Model YAML (215)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.yaml.internal.semantics.YamlSemanticTagProvider (235)
org.openhab.core.model.yaml.internal.YamlModelRepository (234)
  missing references: $000


openHAB Core :: Bundles :: Transformation Service (220)
-------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.transform.internal.TransformationRegistryImpl (287)
org.openhab.core.transform.FileTransformationProvider (284)
  missing references: $000
org.openhab.core.transform.ManagedTransformationProvider (285)
org.openhab.core.transform.TransformationHelper (286)

Why haven’t you just tried to remove all bindings and then start adding them back one by one?

And have you tried removing that EXTRA_JAVA_OPTS? That’s limiting the memory too small for openhab I think.

Ok. So generally you probably proved that your other addons are NOT the cause of the problem. In OH v4 there are a couple of “special” addons that are not just useful as addons, but are also required by the core. I believe these are preloaded during startup before other addons are loaded. The two “special” addons are automation-jsscripting and persistence-rrd4j. So it looks like the first one may be your cause. I would suggest to turn on ‘log:set TRACE org.openhab.automation.jsscripting’ for it and see what you see.

Here is what I tried now:

  • Shut down OH, removed all bindings from addons.config as @JimT proposed; removed userdata/tmp and /cache; removed EXTRA_JAVA_OPTS xmx and xms setting
    The next start threw lots of errors and took some time, so I restarted OH after everything settled.
    Startup still took >1hour.
    This is addons.config now:
:org.apache.felix.configadmin.revision:=L"47"
automation=""
binding=""
misc="openhabcloud"
package="standard"
persistence="rrd4j,mapdb"
service.pid="org.openhab.addons"
suggestionFinderIp=B"false"
suggestionFinderMdns=B"false"
suggestionFinderUpnp=B"false"
transformation=""
ui="basic,habpanel"
voice=",marytts"

This is what diag returned:

openhab> diag
openHAB Core :: Bundles :: Automation (161)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.internal.provider.AutomationResourceBundlesTracker (77)
org.openhab.core.automation.internal.module.factory.EphemerisModuleHandlerFactory (71)
org.openhab.core.automation.ManagedRuleProvider (64)
org.openhab.core.automation.internal.type.ModuleTypeRegistryImpl (84)
org.openhab.core.automation.internal.RuleEngineImpl (66)
org.openhab.core.automation.internal.commands.AutomationCommandsPluggable (69)
org.openhab.core.automation.internal.provider.i18n.ModuleTypeI18nServiceImpl (82)
org.openhab.core.automation.internal.module.provider.AnnotatedActionModuleTypeProvider (73)
org.openhab.core.automation.internal.module.handler.TimerModuleHandlerFactory (72)
org.openhab.core.automation.internal.provider.file.ModuleTypeFileProviderWatcher (80)
  missing references: $000
org.openhab.core.automation.events.AutomationEventFactory (65)
org.openhab.core.automation.internal.RuleEventFactory (67)
org.openhab.core.automation.internal.RuleRegistryImpl (68)
org.openhab.core.automation.internal.parser.gson.RuleGSONParser (75)
org.openhab.core.automation.internal.parser.gson.TemplateGSONParser (76)
org.openhab.core.automation.internal.module.factory.CoreModuleHandlerFactory (70)
org.openhab.core.automation.thingsupport.AnnotatedThingActionModuleTypeProvider (85)
org.openhab.core.automation.internal.parser.gson.ModuleTypeGSONParser (74)
org.openhab.core.automation.internal.provider.ModuleTypeResourceBundleProvider (78)
org.openhab.core.automation.internal.provider.file.TemplateFileProviderWatcher (81)
  missing references: $000
org.openhab.core.automation.internal.template.RuleTemplateRegistry (83)
org.openhab.core.automation.internal.provider.TemplateResourceBundleProvider (79)


openHAB Core :: Bundles :: Automation Script RuleSupport (164)
--------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.module.script.rulesupport.shared.ScriptedRuleProvider (107)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleHandlerFactory (103)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedPrivateModuleHandlerFactory (105)
org.openhab.core.automation.module.script.rulesupport.internal.CacheScriptExtension (101)
org.openhab.core.automation.module.script.rulesupport.internal.RuleSupportScriptExtension (102)
org.openhab.core.automation.module.script.rulesupport.internal.ScriptedCustomModuleTypeProvider (104)
org.openhab.core.automation.module.script.rulesupport.internal.loader.DefaultScriptFileWatcher (106)
  missing references: $000


openHAB Core :: Bundles :: Configuration Dispatcher (171)
---------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.config.dispatch.internal.ConfigDispatcherFileWatcher (132)
  missing references: $001
org.openhab.core.config.dispatch.internal.ConfigDispatcher (131)


openHAB Core :: Bundles :: Model Core (195)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.core.internal.SafeEMFImpl (204)
org.openhab.core.folder (205)
  missing references: $002
org.openhab.core.model.core.internal.ModelRepositoryImpl (203)


openHAB Core :: Bundles :: Model YAML (215)
-------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.model.yaml.internal.semantics.YamlSemanticTagProvider (235)
org.openhab.core.model.yaml.internal.YamlModelRepository (234)
  missing references: $000


openHAB Core :: Bundles :: Transformation Service (220)
-------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.transform.FileTransformationProvider (284)
  missing references: $000
org.openhab.core.transform.internal.TransformationRegistryImpl (287)
org.openhab.core.transform.ManagedTransformationProvider (285)
org.openhab.core.transform.TransformationHelper (286)

openhab>

Turning on ‘log:set TRACE org.openhab.automation.jsscripting’ made no difference (no trace entries in the log) - I think because I also removed jsscripting automation.

The prefixed comma looks a bit odd. But it is probably not the cause of your problem.