Skip to content

Conversation

Nadahar
Copy link
Contributor

@Nadahar Nadahar commented Sep 24, 2025

This fixes #5037 according to my testing.

I'm leaving it as a draft because I assume that there might be further changes. I haven't created proper commit messages either, although that doesn't seem to matter as all PRs seem to be squashed these days.

The first commit isn't really related to this, but it's needed to not get a compilation error in Eclipse when having the discovery bundles open. I've already submitted it as a part of #5031, it doesn't really matter where it's included as long as the compilation error is taken care of.

I've done the rest in two parts, first the fixes necessary to make it work, and then the cleanup of all that's no longer needed. The timer based configuration refresh has been removed, as it was only ever there because the configuration mechanism didn't do what was desired.

The crux of the fix is to modify the org.openhab.addons configuration object to have a "region" location (one that starts with ?). I just called it ?openhab, I have no idea what a "proper location" would be. As far as I understand, any string can be put there as long as it starts with a ?. This is what enables more than one bundle to use the configuration, which then enables the configuration to be supplied via @Activate and @Modified.

I'm pretty sure that with this fix, the timer can be removed from FeatureInstaller as well, although I haven't actually tested this.

I think some of you guys should test/verify that it works as intended for you as well.

@lolodomo
Copy link
Contributor

I am adding logs to your PR and plan to patch my production env with that later today.

@Nadahar
Copy link
Contributor Author

Nadahar commented Sep 27, 2025

I'm sorry, but I'll have to rebase this PR since #5031 has now been merged, and these two PRs shared the first commit (the unrelated nullness annotation).

I'll push the rebased version soon.

@Nadahar Nadahar force-pushed the fix-addon-suggestion-service branch from 6873510 to 0f9a105 Compare September 27, 2025 15:52
@lolodomo
Copy link
Contributor

lolodomo commented Sep 28, 2025

I tried to "patch" my production environment (5.1 milestone 1) by updating (bundle:update) the 2 bundles o.o.core and o.o.core.config.discovery.addon but unfortunately I again encountered the famous problem that original bundles (5.1 milestone 1) are reinstalled automatically and this even leads in that particular case to all my bundles being no more active (probably due to the reinstall of the main bundle o.o.core). I suppose I should build a full distribution and install it. This is not something I am used to.

But at least, I was able to notice what happens at the startup with the new bundles, that is interesting but can't be considered as a real test.

Just to explain my test, I stopped the OH server while all finders were disabled. Then I updated my file conf/services/addons.cfg to enable UPnP finder and then restarted OH server.
What it contains:

# The system can automatically suggest add-ons for installation using add-on finders.
# If you don't want add-on suggestions from specific finders, you can disable the respective finders.
# They are enabled by default.
#
suggestionFinderIp = false
suggestionFinderMdns = false
suggestionFinderSddp = false
suggestionFinderUpnp = true
suggestionFinderUsb = false

First and that is new and a big improvement, a full config is now provided to the activator. I was hoping it could be the config defined in my conf/services/addons.cfg but it is probably the config that is defined in file userdata/config/org/openhab/addons.config, meaning the configuration when I stopped the openHAB server with suggestionFinderUpnp being false and not the new config.
Here are the logs (I logged the config in the activator and in the modified method).

2025-09-27 22:42:24.380 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config core-config-discovery-addon =>
2025-09-27 22:42:24.381 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
2025-09-27 22:42:24.381 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config misc => openhabcloud
2025-09-27 22:42:24.382 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.name => addon-suggestion-service
2025-09-27 22:42:24.384 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config remote => false
2025-09-27 22:42:24.385 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUsb => false
2025-09-27 22:42:24.385 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderMdns => false
2025-09-27 22:42:24.386 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderSddp => false
2025-09-27 22:42:24.386 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config service.pid => org.openhab.addons
2025-09-27 22:42:24.387 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config binding => astro,...,matter
2025-09-27 22:42:24.388 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config ui => basic
2025-09-27 22:42:24.389 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config transformation => map
2025-09-27 22:42:24.389 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderIp => false
2025-09-27 22:42:24.393 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config persistence => rrd4j
2025-09-27 22:42:24.394 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.id => 140
2025-09-27 22:42:24.394 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config voice => voicerss
2025-09-27 22:42:24.395 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUpnp => false


2025-09-27 22:42:24.396 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon =>
2025-09-27 22:42:24.397 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
2025-09-27 22:42:24.397 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config misc => openhabcloud
2025-09-27 22:42:24.398 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
2025-09-27 22:42:24.398 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config remote => false
2025-09-27 22:42:24.399 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-27 22:42:24.400 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-27 22:42:24.400 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
2025-09-27 22:42:24.401 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
2025-09-27 22:42:24.401 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config binding => astro,...,matter
2025-09-27 22:42:24.402 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config ui => basic
2025-09-27 22:42:24.402 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config transformation => map
2025-09-27 22:42:24.403 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-27 22:42:24.403 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config persistence => rrd4j
2025-09-27 22:42:24.404 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 140
2025-09-27 22:42:24.404 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config voice => voicerss
2025-09-27 22:42:24.405 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => false

Then very shortly after, modified is called and this time it is apparently with the expected config (suggestionFinderUpnp being true).


2025-09-27 22:42:24.498 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon =>
2025-09-27 22:42:24.502 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
2025-09-27 22:42:24.503 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config misc => openhabcloud
2025-09-27 22:42:24.504 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
2025-09-27 22:42:24.504 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config remote => false
2025-09-27 22:42:24.505 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-27 22:42:24.505 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-27 22:42:24.506 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
2025-09-27 22:42:24.506 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
2025-09-27 22:42:24.507 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config binding => astro,...,matter
2025-09-27 22:42:24.508 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config ui => basic
2025-09-27 22:42:24.508 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config transformation => map
2025-09-27 22:42:24.509 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-27 22:42:24.509 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config persistence => rrd4j
2025-09-27 22:42:24.510 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 140
2025-09-27 22:42:24.510 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config voice => voicerss
2025-09-27 22:42:24.510 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true
2025-09-27 22:42:24.511 [INFO ] [scovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = true => updating from false to true

2 seconds later, initAddonFinderService is called (by addAddonFinderService ):


2025-09-27 22:42:26.045 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install upnp
2025-09-27 22:42:26.102 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall usb
2025-09-27 22:42:26.103 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall sddp
2025-09-27 22:42:26.104 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall ip
2025-09-27 22:42:26.104 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall mdns

Immediately after, modified is called again, with a new value for key core-config-discovery-addon (changed from empty to ",upnp").

2025-09-27 22:42:26.107 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ,upnp
2025-09-27 22:42:26.118 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
2025-09-27 22:42:26.118 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config misc => openhabcloud
2025-09-27 22:42:26.119 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
2025-09-27 22:42:26.119 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config remote => false
2025-09-27 22:42:26.120 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-27 22:42:26.120 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-27 22:42:26.120 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
2025-09-27 22:42:26.121 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
2025-09-27 22:42:26.121 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config binding => astro,...,matter
2025-09-27 22:42:26.121 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config ui => basic
2025-09-27 22:42:26.134 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config transformation => map
2025-09-27 22:42:26.135 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-27 22:42:26.136 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config persistence => rrd4j
2025-09-27 22:42:26.137 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 140
2025-09-27 22:42:26.138 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config voice => voicerss
2025-09-27 22:42:26.140 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true

Unfortunately, I forgot to log calls to isFinderEnabled to check if it is not called before everything is well setup.

So it looks no so bad if the sequence is systematically this one.

But to run full tests, a build of a new distribution and an installation from this build would be required.

@lolodomo
Copy link
Contributor

lolodomo commented Sep 28, 2025

I tried again with few more logs.
UPnP finder was enabled when I stopped OH. I also enabled SDDP in conf/services/addons.cfg before restarting.

First when the service is activated (old config is considered):

2025-09-28 09:57:45.506 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config core-config-discovery-addon => ,upnp
...
2025-09-28 09:57:45.513 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUsb => false
2025-09-28 09:57:45.514 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderMdns => false
2025-09-28 09:57:45.514 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderSddp => false
2025-09-28 09:57:45.518 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderIp => false
2025-09-28 09:57:45.520 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUpnp => true

2025-09-28 09:57:45.522 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ,upnp
...
2025-09-28 09:57:45.532 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-28 09:57:45.533 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-28 09:57:45.534 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
2025-09-28 09:57:45.542 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-28 09:57:45.547 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true

2025-09-28 09:57:45.551 [INFO ] [scovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = true => updating from false to true

Then some services are added and unfortunately a first call to isFinderEnabled while the real config is not yet loaded:


2025-09-28 09:57:45.552 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider
2025-09-28 09:57:45.553 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService changed
2025-09-28 09:57:45.559 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider
2025-09-28 09:57:45.562 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService changed
2025-09-28 09:57:45.585 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder
2025-09-28 09:57:45.586 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService changed
2025-09-28 09:57:45.587 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true

And the good configuration is loaded:

2025-09-28 09:57:45.623 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ,upnp
...
2025-09-28 09:57:45.630 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-28 09:57:45.630 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-28 09:57:45.631 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
2025-09-28 09:57:45.633 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-28 09:57:45.639 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true

2025-09-28 09:57:45.640 [INFO ] [scovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = true => updating from false to true

Then addAddonFinderService is called followed by modified:

2025-09-28 09:57:47.063 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinderService
2025-09-28 09:57:47.066 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install upnp
2025-09-28 09:57:47.068 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall usb
2025-09-28 09:57:47.074 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install sddp
2025-09-28 09:57:47.136 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall ip
2025-09-28 09:57:47.137 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall mdns

2025-09-28 09:57:47.144 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ,sddp,upnp
2025-09-28 09:57:47.152 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
2025-09-28 09:57:47.158 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
2025-09-28 09:57:47.160 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
2025-09-28 09:57:47.192 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
2025-09-28 09:57:47.204 [INFO ] [scovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true

So it looks like changed and isFinderEnabled is called too early before the good configuration is loaded and before the finder service is installed.

@lolodomo
Copy link
Contributor

@Nadahar : let me know if I was too much confused in my report.

@lolodomo
Copy link
Contributor

lolodomo commented Sep 28, 2025

So it looks like changed and isFinderEnabled is called too early before the good configuration is loaded and before the finder service is installed.

Maybe it is only the ProcessAddonFinder and in this case this is ok as there is no setting for this finder (always installed).

It is too bad that everything stopped so early with a restore of all milestone bundles.
Without that, I imagine that addAddonFinder would have been called later for UPnP and SDDP.

So maybe it works properly but I cannot confirm it unfortunately.
I need to build and install a full distribution.

@Nadahar
Copy link
Contributor Author

Nadahar commented Sep 28, 2025

I again encountered the famous problem that original bundles (5.1 milestone 1) are reinstalled automatically and this even leads in that particular case to all my bundles being no more active (probably due to the reinstall of the main bundle o.o.core).

I can't be sure, but I suspect that this might be caused by different versions (5.1-SNAPSHOT vs 5.1-M1). To avoid them being replaced, you'd probably have to build the replacement ones using 5.1-M1 as the version. But, that's quite the hack, so it might not work.

Alternatively, I've made a dev profile for the distro repo that is aimed making build full Karaf installations for testing a bit easier. It's documented here: https://www.openhab.org/docs/developer/ide/karaf.html

Disregard the debugging part, you don't have to do that unless you want to. You can run the installation directly from the folder created by the dev profile. Please note that, although this generally works for me, a few times I've had it seemingly use "outdated" bundles and not the latest version I've built. When that happens, I've had to add "clean" (mvn clean package -Pdev), which is unfortunate, because that wipes all the settings you have done to that "installation", but I've found no other way. Most of the time, it works fine without "clean" though, which lets me do changes to single bundles and let the dev profile simply update the temporary installation.

I was hoping it could be the config defined in my conf/services/addons.cfg but it is probably the config that is defined in file userdata/config/org/openhab/addons.config, meaning the configuration when I stopped the openHAB server with suggestionFinderUpnp being false and not the new config.

I don't think it's "this or that" config - I think what happens is that the config is first retrieved from a "Karaf cache" where it has the state from when Karaf was last stopped. Then, when the config dispatcher gets up and running, it will modify that cached configuration with what it finds in addons.cfg. "Which config" is received by AddonSuggestionService then depends entirely on the timing. If AddonSuggestionService is created before the config dispatcher is done, those changes won't be there. When the config dispatcher modifies the configuration, AddonSuggestionService will receive a modified. So, my guess is that if you had stopped and started OH again, the next time the Karaf cache would have stored it with the config from addons.cfg included, and it would "have worked from the start".

Immediately after, modified is called again, with a new value for key core-config-discovery-addon (changed from empty to ",upnp").

This is because FeatureInstaller use a property in the same configuration to keep track of which features are currently installed. So, any changes to what is installed will trigger a trigger modified call, but it shouldn't lead to any changes in AddonSuggestionService, since it doesn't use the property that has changed.

Unfortunately, I forgot to log calls to isFinderEnabled to check if it is not called before everything is well setup.

So it looks no so bad if the sequence is systematically this one.

As I've said before, it doesn't really matter if isFinderEnabled is called before the AddonFinderService is registered, it will still correctly reflect what finders are available at that moment. This might change once the AddonFinderService is registered, but it's still correct at that point in time.

I think that some of the "challenges" here goes beyond this fix. This fix only makes sure that the configuration used is the one that is valid at that point in time. The order in which components are started is beyond the realm of this, and if that should be "controlled" in any way, it should be done in some other way.

As I've mentioned before, I think it might make things easier if AddonSuggestionService waited for a certain start level before starting, but that would mean making it optional in AddonResource, or things could cascade in case something goes wrong during startup. Making such a change might require some tweaks to the first time setup wizard so that it will wait for the suggestions to be available from the REST API. AddonResource could reply with an HTTP status "not yet ready" until AddonSuggestionService was registered with AddonResource, which the web UI could use to show a "wait" message to the user.

But again, this whole startup order situation is a bit beyond the scope of this fix, which goes to the handling of the configuration.

So it looks like changed and isFinderEnabled is called too early before the good configuration is loaded and before the finder service is installed.

If it's "too early" depends on what is asking IMO. It's not a problem in the sense that it will correctly report which finders are available at that time, but it won't report what finders will be available after the AddonFinderService has made changes to installed features, because it can't really predict the future.

let me know if I was too much confused in my report.

No, I think it's fine and useful 👍

Maybe it is only the ProcessAddonFinder and in this case this is ok as there is no setting for this finder (always installed).

It is too bad that everything stopped so early with a restore of all milestone bundles. Without that, I imagine that addAddonFinder would have been called later for UPnP and SDDP.

So maybe it works properly but I cannot confirm it unfortunately. I need to build and install a full distribution.

Try the procedure I suggested above with the dev profile - it is what I've used for testing this.

But I also tell me that if all finders were enabled before I stopped OH, then at restart addAddonFinder would have been called before the real configuration is loaded and so even if I disabled them in conf/services/addons.cfg, leading to changed being called and isFinderEnabled being called while the outdated config.

I'm not sure that this is a problem, because the motivation for disabling the finders is primarily to save system resources. In that case, they will normally have been disabled the last time the system stopped as well. But, if we want to make this really "waterproof", we'll have to make the AddonSuggestionService wait until the config dispatcher is done parsing config and AddonFinderService is up and running.

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

Ok, I installed from scratch from a snapshot I built myself from your PR but with logs added.
First I am in the very initial configuration that interests @andrewfg for a new user just after a first startup after unzipping the distribution.
Bindings are properly suggested, all finders are enabled and logs look good to me:

12:18:06.814 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 5.1.0 (- local build -)
12:18:10.121 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:18:10.122 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.name => addon-suggestion-service
12:18:10.123 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.id => 125
12:18:10.125 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:18:10.126 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:18:10.127 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 125
12:18:10.129 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = null => updating from false to true
12:18:10.131 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig usb-addon-suggestion-finder suggestionFinderUsb = null => updating from false to true
12:18:10.132 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = null => updating from false to true
12:18:10.133 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig ip-addon-suggestion-finder suggestionFinderIp = null => updating from false to true
12:18:10.134 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig mdns-addon-suggestion-finder suggestionFinderMdns = null => updating from false to true
12:18:10.135 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder ProcessAddonFinder
12:18:10.136 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:10.139 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:10.140 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinderService KarafAddonFinderService
12:18:10.141 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install upnp
12:18:10.144 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install usb
12:18:10.150 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install sddp
12:18:10.153 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install ip
12:18:10.155 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install mdns
12:18:10.157 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider AddonInfoAddonsXmlProvider
12:18:10.159 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:10.160 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:10.212 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:18:10.214 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => usb,sddp,upnp
12:18:10.215 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:18:10.217 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:18:10.220 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 125
12:18:10.227 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:18:10.231 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => usb,ip,sddp,upnp,mdns
12:18:10.232 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:18:10.234 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:18:10.235 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 125
12:18:10.517 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider XmlAddonInfoProvider
12:18:10.519 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:10.520 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:12.631 [WARN ] [org.openhab.core.net.NetUtil         ] - Found multiple local interfaces - ignoring 192.168.1.10
12:18:12.931 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
12:18:16.038 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder UpnpAddonFinder
12:18:16.041 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:16.044 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:16.045 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:18:19.943 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder MDNSAddonFinder
12:18:19.944 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:19.946 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:19.947 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:18:19.948 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:18:20.109 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder SddpAddonFinder
12:18:20.111 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:20.113 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:20.114 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:18:20.115 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:18:20.138 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => true
12:18:24.819 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.
12:18:40.176 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder UsbAddonFinder
12:18:40.177 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:40.178 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:40.178 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:18:40.179 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:18:40.207 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => true
12:18:40.208 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UsbAddonFinder => true
12:18:40.220 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder IpAddonFinder
12:18:40.221 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:18:40.222 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:18:40.223 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:18:40.224 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:18:40.254 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => true
12:18:40.255 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UsbAddonFinder => true
12:18:40.256 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled IpAddonFinder => true
12:21:16.216 [WARN ] [e.io.rest.auth.internal.TokenResource] - Couldn't find a user with a session matching the provided refresh_token
12:21:16.218 [WARN ] [e.io.rest.auth.internal.TokenResource] - Token issuing failed: invalid_grant
12:21:37.836 [INFO ] [tp.auth.internal.AuthorizePageServlet] - First user account created: xxx
12:21:46.127 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Paris'.
12:21:46.129 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Locale set to 'fr_FR'.
12:22:33.802 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:22:33.837 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:22:33.842 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:22:33.853 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => true
12:22:33.856 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UsbAddonFinder => true
12:22:33.860 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled IpAddonFinder => true
image

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

Now I stop OH, change my addons.cfg like that to disable IP, SDDP and USB finders and restart OH:

suggestionFinderIp = false
#suggestionFinderMdns = true
suggestionFinderSddp = false
#suggestionFinderUpnp = true
suggestionFinderUsb = false

Logs look good, we can see that the disabled finders in conf are first loaded (IpAddonFinder and SddpAddonFinder, but not USB finder) but at this time, you already have the setting that they must not be used. And later these 2 finders are uninstalled and removed:

12:34:49.459 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 5.1.0 (- local build -)
12:34:49.994 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Paris'.
12:34:49.996 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Locale set to 'fr_FR'.
12:34:51.964 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config service.pid => org.openhab.addons
12:34:51.969 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config core-config-discovery-addon => usb,ip,sddp,upnp,mdns
12:34:51.971 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:34:51.976 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.name => addon-suggestion-service
12:34:51.978 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.id => 138
12:34:51.981 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:34:51.984 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => usb,ip,sddp,upnp,mdns
12:34:51.986 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:34:51.989 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:34:51.991 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:34:52.004 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = null => updating from false to true
12:34:52.005 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig usb-addon-suggestion-finder suggestionFinderUsb = null => updating from false to true
12:34:52.010 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = null => updating from false to true
12:34:52.015 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig ip-addon-suggestion-finder suggestionFinderIp = null => updating from false to true
12:34:52.018 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig mdns-addon-suggestion-finder suggestionFinderMdns = null => updating from false to true
12:34:52.021 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider AddonInfoAddonsXmlProvider
12:34:52.029 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:34:52.032 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider XmlAddonInfoProvider
12:34:52.050 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:34:52.080 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder ProcessAddonFinder
12:34:52.081 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:34:52.085 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:34:52.134 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:34:52.138 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:34:52.140 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => usb,ip,sddp,upnp,mdns
12:34:52.141 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:34:52.148 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:34:52.149 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:34:52.150 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:34:52.154 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:34:52.155 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig usb-addon-suggestion-finder suggestionFinderUsb = false => updating from true to false
12:34:52.159 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = false => updating from true to false
12:34:52.161 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig ip-addon-suggestion-finder suggestionFinderIp = false => updating from true to false
12:34:53.464 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinderService KarafAddonFinderService
12:34:53.466 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install upnp
12:34:53.469 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall usb
12:34:53.472 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall sddp
12:34:53.480 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall ip
12:34:53.481 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:34:53.485 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install mdns
12:34:53.486 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:34:53.490 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ip,upnp,mdns
12:34:53.494 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:34:53.495 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:34:53.496 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:34:53.497 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:34:53.502 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:34:53.508 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:34:53.512 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:34:53.515 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => upnp,mdns
12:34:53.516 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:34:53.517 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:34:53.520 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:34:53.523 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:34:53.524 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:34:56.189 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder MDNSAddonFinder
12:34:56.190 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:34:56.191 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:34:56.192 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:34:57.856 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
12:34:59.938 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder IpAddonFinder
12:34:59.945 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:34:59.948 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:34:59.949 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:34:59.995 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled IpAddonFinder => false
12:35:00.989 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder SddpAddonFinder
12:35:00.991 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:35:00.995 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:35:00.997 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:35:01.060 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled IpAddonFinder => false
12:35:01.061 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => false
12:35:01.195 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder UpnpAddonFinder
12:35:01.196 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:35:01.199 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:35:01.200 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:35:01.339 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled IpAddonFinder => false
12:35:01.341 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => false
12:35:01.343 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:35:03.460 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService removeAddonFinder
12:35:04.565 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService removeAddonFinder
12:35:05.434 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.

I then check what bundles are installed, this is consistent:

bundle:list -s | grep discovery
170 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery
171 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery.addon
172 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.process
173 x Active x  80 x 5.1.0.202509280901    x org.openhab.core.config.discovery.mdns
249 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.upnp
255 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.mdns

Settings are as expected in UI:
image

I then enable SDDP finder in Main UI, configuration is immediately updated and new finder is installed:

12:49:08.986 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:49:08.988 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:49:08.989 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => upnp,mdns
12:49:08.990 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:49:08.991 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:49:08.992 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:49:08.993 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:49:08.994 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
12:49:08.995 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = true => updating from false to true
12:49:08.996 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified install sddp
12:49:09.003 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:49:09.004 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:49:09.005 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp,upnp,mdns
12:49:09.006 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:49:09.007 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:49:09.008 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:49:09.010 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:49:09.011 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
12:49:09.968 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder SddpAddonFinder
12:49:09.969 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:49:09.970 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:49:09.971 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled MDNSAddonFinder => true
12:49:10.009 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
12:49:10.010 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => true

New bundle is installed:

bundle:list -s | grep discovery
170 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery
171 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery.addon
172 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.process
173 x Active x  80 x 5.1.0.202509280901    x org.openhab.core.config.discovery.mdns
249 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.upnp
255 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.mdns
267 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.sddp
268 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.sddp

I then disable mDNS finder in Main UI, configuration is immediately updated and finder is uninstalled:

12:53:26.603 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:53:26.604 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp,upnp,mdns
12:53:26.605 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:53:26.605 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:53:26.606 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:53:26.606 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
12:53:26.607 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:53:26.607 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:53:26.608 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:53:26.608 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig mdns-addon-suggestion-finder suggestionFinderMdns = false => updating from true to false
12:53:26.609 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified uninstall mdns
12:53:26.613 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:53:26.615 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp,upnp
12:53:26.616 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:53:26.616 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:53:26.617 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:53:26.618 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
12:53:26.619 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:53:26.620 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:53:26.621 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:53:27.469 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService removeAddonFinder

Bundle is uninstalled:

bundle:list -s | grep discovery
170 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery
171 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery.addon
172 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.process
173 x Active x  80 x 5.1.0.202509280901    x org.openhab.core.config.discovery.mdns
249 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.upnp
267 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.sddp
268 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.sddp

I stop OH and change my conf/services/addons.cfg to diabled all finders:

suggestionFinderIp = false
suggestionFinderMdns = false
suggestionFinderSddp = false
suggestionFinderUpnp = false
suggestionFinderUsb = false

Logs at startup look good, the SDDP finder is loaded but then uninstalled. When isFinderEnabled is called for SddpAddonFinder, the setting is false:

12:57:53.675 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 5.1.0 (- local build -)
12:57:54.294 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Paris'.
12:57:54.295 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Locale set to 'fr_FR'.
12:57:56.115 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:57:56.120 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config core-config-discovery-addon => sddp,upnp
12:57:56.123 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.name => addon-suggestion-service
12:57:56.128 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUsb => false
12:57:56.131 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderMdns => false
12:57:56.134 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderSddp => true
12:57:56.138 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config service.pid => org.openhab.addons
12:57:56.140 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderIp => false
12:57:56.141 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.id => 138
12:57:56.143 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:57:56.145 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp,upnp
12:57:56.146 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:57:56.148 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:57:56.150 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:57:56.151 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => true
12:57:56.153 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:57:56.154 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:57:56.155 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:57:56.162 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = null => updating from false to true
12:57:56.163 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = true => updating from false to true
12:57:56.170 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider AddonInfoAddonsXmlProvider
12:57:56.173 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:57:56.177 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider XmlAddonInfoProvider
12:57:56.178 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:57:56.187 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder ProcessAddonFinder
12:57:56.189 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:57:56.190 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:57:56.253 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:57:56.258 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp,upnp
12:57:56.260 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:57:56.266 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:57:56.267 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:57:56.268 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:57:56.273 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:57:56.274 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:57:56.275 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:57:56.276 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => false
12:57:56.277 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = false => updating from true to false
12:57:56.282 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig sddp-addon-suggestion-finder suggestionFinderSddp = false => updating from true to false
12:57:57.522 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinderService KarafAddonFinderService
12:57:57.524 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall upnp
12:57:57.535 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:57:57.533 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall usb
12:57:57.539 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall sddp
12:57:57.539 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => sddp
12:57:57.540 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:57:57.541 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall ip
12:57:57.544 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall mdns
12:57:57.544 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:57:57.546 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:57:57.550 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:57:57.552 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:57:57.557 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:57:57.559 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:57:57.560 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => false
12:57:57.570 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
12:57:57.572 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon =>
12:57:57.573 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
12:57:57.578 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
12:57:57.579 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
12:57:57.580 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
12:57:57.584 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
12:57:57.586 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
12:57:57.588 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
12:57:57.590 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => false
12:58:01.538 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
12:58:03.431 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder SddpAddonFinder
12:58:03.433 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
12:58:03.437 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
12:58:03.438 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled SddpAddonFinder => false
12:58:04.548 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.
12:58:04.838 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService removeAddonFinder

Bundles are as expected:

bundle:list -s | grep discovery
170 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery
171 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery.addon
172 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.process
173 x Active x  80 x 5.1.0.202509280901    x org.openhab.core.config.discovery.mdns

No binding is suggested by Main UI:
image

Final test, I stop OH and change my conf/services/addons.cfg to enable UPnP finder:

suggestionFinderIp = false
suggestionFinderMdns = false
suggestionFinderSddp = false
suggestionFinderUpnp = true
suggestionFinderUsb = false

Logs at startup look good, the UPnP finder is nstalled and when isFinderEnabled is called for UpnpAddonFinder, the setting is true:

13:06:07.703 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 5.1.0 (- local build -)
13:06:08.113 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Paris'.
13:06:08.114 [INFO ] [b.core.internal.i18n.I18nProviderImpl] - Locale set to 'fr_FR'.
13:06:09.880 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
13:06:09.882 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config core-config-discovery-addon =>
13:06:09.884 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.name => addon-suggestion-service
13:06:09.886 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUsb => false
13:06:09.887 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderMdns => false
13:06:09.889 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderSddp => false
13:06:09.890 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config service.pid => org.openhab.addons
13:06:09.893 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderIp => false
13:06:09.894 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config component.id => 138
13:06:09.895 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService constructor config suggestionFinderUpnp => false
13:06:09.897 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
13:06:09.899 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon =>
13:06:09.900 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
13:06:09.901 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
13:06:09.902 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
13:06:09.903 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
13:06:09.904 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
13:06:09.905 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
13:06:09.906 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
13:06:09.908 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => false
13:06:09.912 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider AddonInfoAddonsXmlProvider
13:06:09.913 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
13:06:09.917 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonInfoProvider XmlAddonInfoProvider
13:06:09.918 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
13:06:09.943 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder ProcessAddonFinder
13:06:09.945 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
13:06:09.946 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
13:06:10.000 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
13:06:10.014 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon =>
13:06:10.015 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
13:06:10.023 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
13:06:10.034 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
13:06:10.035 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
13:06:10.036 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
13:06:10.038 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
13:06:10.043 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
13:06:10.047 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true
13:06:10.052 [INFO ] [iscovery.addon.AddonSuggestionService] - baseFinderConfig upnp-addon-suggestion-finder suggestionFinderUpnp = true => updating from false to true
13:06:11.322 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinderService KarafAddonFinderService
13:06:11.324 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService install upnp
13:06:11.327 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall usb
13:06:11.333 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall sddp
13:06:11.335 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall ip
13:06:11.336 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService initAddonFinderService uninstall mdns
13:06:11.331 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
13:06:11.338 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config core-config-discovery-addon => ,upnp
13:06:11.339 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.name => addon-suggestion-service
13:06:11.341 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUsb => false
13:06:11.346 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderMdns => false
13:06:11.347 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderSddp => false
13:06:11.349 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config service.pid => org.openhab.addons
13:06:11.354 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderIp => false
13:06:11.355 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config component.id => 138
13:06:11.357 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService modified config suggestionFinderUpnp => true
13:06:14.491 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService addAddonFinder UpnpAddonFinder
13:06:14.494 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService changed
13:06:14.498 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled ProcessAddonFinder => true
13:06:14.500 [INFO ] [iscovery.addon.AddonSuggestionService] - AddonSuggestionService isFinderEnabled UpnpAddonFinder => true
13:06:16.388 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
13:06:23.380 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.

Bundles are as expected:

bundle:list -s | grep discovery
170 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery
171 x Active x  80 x 5.1.0.202509280859    x org.openhab.core.config.discovery.addon
172 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.process
173 x Active x  80 x 5.1.0.202509280901    x org.openhab.core.config.discovery.mdns
270 x Active x  80 x 5.1.0.202509280900    x org.openhab.core.config.discovery.addon.upnp

Here are the suggested bindins in Main UI:
image

As a conclusion, it looks to work as we expect. Bravo @Nadahar for this great improvment.
I believe you can mark the PR as ready for review.

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

In addition to positive tests, the code looks good to me even if I am not at all an expert in OSGi and can't really challenge the code changes but @Nadahar apparently succeeded to remove the hack that was previously implemented to load the configuration. Configuration is now properly provided to the activator and to the @Modified method.

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

that interests @andrew-schofield

Are you sure you didn't mean @andrewfg?

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

Thank you for a thorough and well documented test @lolodomo. I'm really only waiting for @mherwege to have a chance to look at it before taking it out of draft, because I understood it as if @andrewfg isn't going to.

If release of M2 is getting close, please let me know and we'll have to figure out what to do.

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

that interests @andrew-schofield

Are you sure you didn't mean @andrewfg?

Yes, fixed

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

If release of M2 is getting close, please let me know and we'll have to figure out what to do.

M2 is not yet planned. But we should have this fix available in a snapshot before building M2, so my suggestion is to not delay too much the review, also considering that I already reviewed it.

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

M2 is not yet planned. But we should have this fix available in a snapshot before building M2, so my suggestion is to not delay too much the review, also considering that I already reviewed it.

Maybe @mherwege can give is a hint as to how his future schedule looks, so we know a bit about what kind of waiting time we're looking at?

@mherwege
Copy link
Contributor

mherwege commented Oct 4, 2025

I didn’t test myself, but looked at the extensive test @lolodomo already did. @Nadahar I am impressed. Great work. I think this is absolutely ready for review, so we can get it merged as soon as possible. I am far from an OSGI expert myself and looked at similar patterns when coding this. As far as I can tell, the code looks good.

One thing I am now thinking: I copied the configuration synchronization pattern from the FeatureInstaller code. Would it be better to remove that pattern in a similar way there as well?

@mherwege
Copy link
Contributor

mherwege commented Oct 4, 2025

Maybe @mherwege can give is a hint as to how his future schedule looks, so we know a bit about what kind of waiting time we're looking at?

I am not a maintainer, so I have no inside info on the schedule at all. @lolodomo is probably better placed on it than I am. I got involved in this because I contributed this part of the code initially. It was as good as I succeeded in making it, but we have seen the behavior was not without its challenges. And you improved that a lot.

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

One thing I am now thinking: I copied the configuration synchronization pattern from the FeatureInstaller code. Would it be better to remove that pattern in a similar way there as well?

As I mentioned somewhere else, the same could probably be done there yes, because of the changes I did here, the FeatureInstaller should also be notified properly now (the whole problem was that the configuration couldn't be shared between bundles - it now can, and thus they will all be notified).

But, I didn't want to bite over too much at once, FeatureInstaller is a very central component where any f.up would have big consequences. Also, it uses the configuration in a slightly more complicated pattern, so it should be made sure that "all paths are covered" before removing the scheduled refresher. It's obviously better not to have to rely on such techniques, it introduces delays and unpredictability as to when things will happen.

@Nadahar Nadahar marked this pull request as ready for review October 4, 2025 14:21
@Nadahar Nadahar requested a review from a team as a code owner October 4, 2025 14:21
@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

To the reviewer: As this was "a work in progress" until it suddenly wasn't, I never wrote proper commit messages. I can correct it, but that would mean a forced push, and since you squash PRs anyway, I'm not sure that it matters?

@lolodomo
Copy link
Contributor

lolodomo commented Oct 4, 2025

There is no strict planning for milestones but generally we try to consider one milestone per month, so around 4 or 5 weeks between each milestone.

@holgerfriedrich
Copy link
Member

@Nadahar I'd appreciate if you could squash and provide the proper commit message.
I don't mind about force pushes, as long as we are not in the middle of a review.
Thanks!

AddonSuggestionService has had a delayed application of configuration because it was based on a timer that refreshed it every minute. This led to various issue where "wrong decision" were made based on stale information. This addresses the root cause for why the configuration wasn't delivered in a timely manner by OSGi, and removes the scheduled configuration refresh.

For the configuration to be accessible to multiple bundles, its "location" must be "a region". This must be configured before any bundle tries to use the configuration. To do this very early, it has been attached to the Activator of the "main core bundle". It doesn't have to be there, as long as it will always run very early during startup.

Signed-off-by: Ravi Nadahar <[email protected]>
@Nadahar Nadahar force-pushed the fix-addon-suggestion-service branch from 0f9a105 to 3e3c97a Compare October 4, 2025 17:30
@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

@holgerfriedrich Commits have been squashed and a new commit message created. I did some explanation in the commit message, so it's easy to find later - I hope that's ok.

Since I had to do a force push anyway, I also rebased it on the latest main. No changes have been done to the actual code.

@Nadahar Nadahar changed the title Fix AddonSuggestionService Fix AddonSuggestionService configuration Oct 4, 2025
@holgerfriedrich
Copy link
Member

holgerfriedrich commented Oct 4, 2025

First of all: @Nadahar Thank you for your work on this topic!

@lolodomo Thank you for the extensive test and the full documentation!

@openhab/core-maintainers Overall, I think this is approach is cleaner than before, fixes the issue introduced recently, and has been tested to work. If there are some doubts regarding the way the startup is hooked into Activator.java or any proposal how to do this in a way better fitting to the OSGi world, please speak up now!

@andrewfg Do you still have any concerns regarding the change from polling config changes every minute to proper modification based triggering?

M2 is still a few weeks ahead. But we should get this done in the next days to give it some more testing.

@holgerfriedrich holgerfriedrich added the bug An unexpected problem or unintended behavior of the Core label Oct 4, 2025
@andrewfg
Copy link
Contributor

andrewfg commented Oct 4, 2025

@holgerfriedrich I will make a build and test it tomorrow.

Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
No objections communicated until now, so let's go for it.

@holgerfriedrich holgerfriedrich merged commit 9d67971 into openhab:main Oct 8, 2025
5 checks passed
@holgerfriedrich holgerfriedrich added this to the 5.1 milestone Oct 8, 2025
@Nadahar Nadahar deleted the fix-addon-suggestion-service branch October 8, 2025 19:41
@lolodomo
Copy link
Contributor

@openhab/core-maintainers : I believe the label "regression" should be added to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An unexpected problem or unintended behavior of the Core regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Addon Finder Services no longer run on OH new install

5 participants