Heiko Studt created FELIX-6510:
----------------------------------

             Summary: NPE within HealthCheck BundlesStartedCheck for bad Bundle
                 Key: FELIX-6510
                 URL: https://issues.apache.org/jira/browse/FELIX-6510
             Project: Felix
          Issue Type: Improvement
          Components: Health Checks
            Reporter: Heiko Studt


TL;DR: If you have configured the BundlesStartedCheck and there was any bundle 
installed without correct OSGI headers (ls is showing `null 0.0.0`), the 
BundlesStartedCheck will report some NPE and does not log anything to file and 
neither the reason nor a stack trace into the health-check frontend. The latter 
(no stack-trace) is a good thing, though.

If you have switched on the debug-level "all", it will stop after some lines 
"Bundle [...] not matched by [...]"; the exception itself is then swallowed and 
not logged into the osgi runner log, so that one has to wonder why it has 
happened.

In my osgi runner there was a bundle installed which was shown by "ls -l" as 
"null 0.0.0". It was created from an unit-test jar included by an error.

According to removing that bundle is solving the problem, I assume the 
following code is the culprit.

[https://github.com/apache/felix-dev/blob/5becb8f971f904334eb3f32e7eaa9126186a2898/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/BundlesStartedCheck.java#L149]

b.getHeaders().get(Constants.BUNDLE_ACTIVATIONPOLICY)

In my point of view, we should add a null check for b.getHeader() or at least 
report the culprit bundle name of the exception.

Should I create a Pull Request for the null check?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to