Expired metadata at startup leads to NPE in status page
Basics
Logistics
Basics
Logistics
Description
Environment
None
Activity
Rod Widdowson
May 23, 2020 at 3:37 PM
That gauge code makes my head ache. The multi-deep "just in time" constructors are weird, but in a kind of cool way,
It actually turns out that issue isn't in the gauges at all, but rather in the way that the chaining provider returns lastXYZ dates (which is by asking each child in turn) this was tripping over the fact that it sometime hasn't happened before for one of them and so the value it null and one has to be able to handle that.
Rod Widdowson
May 23, 2020 at 3:18 PM
(edited)
The detailsed log shows whats up
Caused by: java.lang.NullPointerException: null
at java.base/java.time.Instant.compareTo(Instant.java:1254)
at java.base/java.time.Instant.isBefore(Instant.java:1284)
at org.opensaml.saml.metadata.resolver.ChainingMetadataResolver.getLastUpdate(ChainingMetadataResolver.java:183)
at net.shibboleth.idp.saml.metadata.impl.MetadataResolverServiceGaugeSet$1$1.accept(MetadataResolverServiceGaugeSet.java:77)
at net.shibboleth.idp.saml.metadata.impl.MetadataResolverServiceGaugeSet$1$1.accept(MetadataResolverServiceGaugeSet.java:1)
Rod Widdowson
May 14, 2020 at 6:20 PM
The immediate fix of course is to complicate the ternary with another one on that line.
foo = bar == null ? null : bar.wibble() == null ? null : bar.wibble().foo():
but fixing the underlining thing would be better (return something for uninitialised service).
Or both
Fixed
Details
Details
Assignee
Rod Widdowson
Rod WiddowsonReporter
Scott Cantor
Scott CantorComponents
Fix versions
Affects versions
Created May 14, 2020 at 6:13 PM
Updated May 24, 2020 at 10:50 AM
Resolved May 23, 2020 at 3:37 PM
It appears that a reference to expired metadata at startup seems to ripple out as a status page crash because of something to do with the metrics. The updates variable in the page seems to have no value and crashes at line 83.
This may not be fixable, it may be the inevitable result of those BiConsumer things that defer the metric init so service startup failures don't crash the beans. This is a better outcome. But since it's an NPE it seems like it should be guardable in some way.