Repository navigation
Conversation
… none KarafExtender installed every boot feature from etc/featuresBoot.d and the repository features.boot files in one installFeatures call, so one feature that no repository provides stopped all of them from installing. Each feature is now checked with FeaturesService.getFeatures first. A missing feature is skipped, with an ERROR that names it and the files that list it, and the others are installed. KarDependencyHandler uses the same check for features that wait on a .kar. Extender errors are now sticky: the Karaf extender health check stays at Failure and lists every error, even after both install threads finish.
…6-karaf-extender-featuresboot-fix
…a space Each error in the list now ends with a period, so the message reads '... from those files. Feature ...' instead of '... from those files.; Feature ...'.
cgorantla
reviewed
Dec 2, 2026
Contributor
This PR seems to only fix the missing feature part. Need to think if we should throw and stop the boot. |
…ce and docs - Skip a boot entry that Karaf can't parse (IllegalArgumentException from getFeatures, for example 'foo/[1,'), like a missing feature, instead of letting it stop every boot feature from installing. - After the first lookup failure of another kind, log one WARN and install the remaining features without checking them. - Advise a '!' line, not an edit, for entries in repository features.boot files; give no advice for wait-for-kar entries, which '!' can't remove. - Health check message: no '..' or '.:', no trailing space. - Test KarDependencyHandler.run() through a package-private constructor that takes the .kar storage folder. - Record the current '!' matching rules in tests; '!' behavior unchanged. - Docs: boot feature files, missing/invalid entries and the exact '!' rules in development/minion/container.adoc (fix features.uri name); link it from the core install page; update the release notes, including the effect on container health checks.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Karaf extender installs the boot features from
etc/featuresBoot.d/and from thefeatures.bootfiles of the repositories inrepositories/andsystem/. It installed all of them in oneFeaturesService.installFeaturescall. Karaf resolves every name before it installs a feature. At the first name that no feature repository provides, Karaf throwsNo matching features for <name>/<version>, and the whole call fails.Thus one stale entry stopped all boot features from installing, for example plugins, the Kafka producer and the gRPC exporter. OpenNMS continued to run, but those features were not installed. The log named only the first missing feature. It did not name the file, and it did not say that the other features were not installed. This problem also occurs on Minion and Sentinel. On those systems,
featuresBoot.dusually holds most of the configuration.NMS-20603 removed the
vaadin-snmp-events-and-metricsfeature. A stale entry for that feature infeaturesBoot.dcaused this failure. The release notes for NMS-20603 described the failure. This PR fixes it.This PR:
.karfile;Failureafter an extender error. The check lists all errors.Changes
Check each feature before the install (
BootFeatureInstaller)A new class,
BootFeatureInstaller, has the install step. The main install thread inKarafExtenderand the.karinstall thread inKarDependencyHandlerboth use it.nameorname/version). Thus a feature that two files list gets one check and one ERROR. The ERROR names the two files.FeaturesService.getFeatures(String nameOrId). In Karaf 4.4.11, this method usesFeatureReq.parseNameAndRange.installFeaturesuses the same parser. Thus the check finds the same features that the install accepts, also for version ranges.Feature 'no-such-feature' listed in etc/featuresBoot.d/test.boot was not found and was skipped. Remove it from that file.getFeaturesthrows an exception, the installer keeps the feature in the install set.installFeaturesthen reports the failure.installFeaturescall. One call for each feature is slower, because each call does a full resolve and refresh.Failed to install non-KAR features [...]. None of them were installedThe log shows the exception after this line. The health check message adds
: <cause>.The installer does not use
Option.NoFailOnFeatureNotFound. With that option, Karaf skips a missing feature, but it does not tell us which feature it skipped.Record the source file of each feature (
Feature.source)Featurehas a newsourcefield.KarafExtender.getFeaturesIn()sets it to the path of the file, relative to Karaf home, for exampleetc/featuresBoot.d/kafka.bootorrepositories/<name>/features.boot. The field is used only in messages. It is not part ofequalsorhashCode, so a!<feature>line in one file still removes the same feature from another file.Keep extender errors in the health check (
ExtenderStatus)Before this PR, the health check showed only the last message. When both install threads finished,
areWeCompletelyDone()set the status toSuccess, also after an error. The "Waiting on …" message from the.karthread also replaced an earlierFailurewithStarting.Now
ExtenderStatuskeeps a list of all errors:Failure. Each later message adds the list of errors, for exampleWaiting on [some-kar]. Problem: Feature 'x' listed in …or3 non-KAR features installed. 2 problems: Feature 'x' … Feature 'y' ….Failed to add feature repository '…'. Skippingnow also keeps the status atFailure.ExtenderStatus, so its methods are nowsynchronized.To clear the failure, the operator removes the entry, or adds
!<feature>to a file infeaturesBoot.d, and restarts. No command resets the health check. The follow-up ticket for anopennms:health-check --clearoption is in progress.Other changes
KarDependencyHandler: usesBootFeatureInstaller. Before this PR, a missing.karfeature stopped all.karfeatures. After an error, the handler also set the health check back toSuccess.container/extender/pom.xml: addsmockito-coreas a test dependency. The version comes from the root POM.whatsnew.adoc:featuresBoot.dnow gives the new behavior.Import-Packageheader of the bundle did not change.Manual test
Do these steps on OpenNMS. Then do steps 1 to 6 again on Minion or Sentinel, if possible.
opennms-kafka-producer. Make sure thatfeature:list -i | grep kafka-producershows nothing.etc/featuresBoot.d/kafka-producer.bootwith the lineopennms-kafka-producer.etc/featuresBoot.d/test.bootwith the lineno-such-feature.etc/featuresBoot.d/test2.bootwith the linesno-such-featureandother-missing-feature/[99,100).karaf.loghas one ERROR forno-such-featurethat namestest.bootandtest2.boot, and one ERROR forother-missing-feature/[99,100).feature:list -i | grep kafka-producershows the feature as installed.opennms:health-checkshows "Karaf extender" asFailure, and the message lists the two missing features.curl -s -o /dev/null -w '%{http_code}\n' -u admin:admin http://localhost:8980/opennms/rest/health/probereturns599.test.bootandtest2.boot. Restart OpenNMS.opennms:health-checkshows "Karaf extender" asSuccess, and the probe returns200.!no-such-featureto a new file infeaturesBoot.d, and put backtest.boot. Restart. Make sure thatkaraf.loghas no ERROR forno-such-feature.Follow-ups not in this PR
Add
opennms:health-check --clearto acknowledge Karaf extender errors. In the case where there is an error that was skipped, as in the above manual test, the user might want to clear thehealth-checkfailure status (basicallyackingit), so thathealth-checkthen reports only new errors, instead of it always reporting a bad state for an already-acknowledged error. To be done in NMS-20669.opennms:health-checkgarbles its output when a message is wider than the terminal. While testing this PR, the errors messages inhealth-checkare fairly long, and I found that they seemed to repeat. This is due to a bug in ourhealth-checkconsole output. To be fixed in NMS-20670.External References