Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in EndpointServerWebExchangeMatcher.matches #14161

Closed
madgnome opened this issue Aug 21, 2018 · 6 comments
Closed

NullPointerException in EndpointServerWebExchangeMatcher.matches #14161

madgnome opened this issue Aug 21, 2018 · 6 comments
Labels
type: bug A general bug
Milestone

Comments

@madgnome
Copy link

We're getting NPE in EndpointServerWebExchangeMatcher.matches when starting our service (Spring Boot 2.0.4)

java.lang.NullPointerException: null
	at org.springframework.boot.actuate.autoconfigure.security.reactive.EndpointRequest$EndpointServerWebExchangeMatcher.matches(EndpointRequest.java:238)
	at org.springframework.boot.security.reactive.ApplicationContextServerWebExchangeMatcher.matches(ApplicationContextServerWebExchangeMatcher.java:57)
	at org.springframework.security.web.server.MatcherSecurityWebFilterChain.matches(MatcherSecurityWebFilterChain.java:48)
	at org.springframework.security.web.server.WebFilterChainProxy.lambda$filter$0(WebFilterChainProxy.java:50)
	at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.drain(FluxFilterWhen.java:242)
	at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onNext(FluxFilterWhen.java:131)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
	at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:244)
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:202)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
	at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onSubscribe(FluxFilterWhen.java:190)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:140)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:64)
	at reactor.core.publisher.FluxLiftFuseable.subscribe(FluxLiftFuseable.java:70)
	at reactor.core.publisher.FluxFilterWhen.subscribe(FluxFilterWhen.java:68)
	at reactor.core.publisher.FluxLift.subscribe(FluxLift.java:46)
	at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoPeek.subscribe(MonoPeek.java:71)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoPeek.subscribe(MonoPeek.java:71)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.Mono.subscribe(Mono.java:3080)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoSubscriberContext.subscribe(MonoSubscriberContext.java:47)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
	at reactor.core.publisher.MonoLift.subscribe(MonoLift.java:46)
	at reactor.core.publisher.Mono.subscribe(Mono.java:3080)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)
	at reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:56)
	at reactor.ipc.netty.channel.ChannelOperations.applyHandler(ChannelOperations.java:380)
	at reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart(HttpServerOperations.java:398)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
	at java.lang.Thread.run(Thread.java:748)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 21, 2018
@snicoll
Copy link
Member

snicoll commented Aug 21, 2018

@madgnome thanks for the report but it would help to provide more details. Does it happen all the time? Is it broken on upgrade? A simple application we can run ourselves (link to a repo or zip) would be ideal.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Aug 21, 2018
@madgnome
Copy link
Author

madgnome commented Aug 22, 2018

Only happened once so far just after startup.

image

Unfortunately I don't have a reproducible app, I assume it's a concurrency issue on initialization.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 22, 2018
@snicoll
Copy link
Member

snicoll commented Aug 22, 2018

That's interesting, looks like your heartbeat checks invoke the endpoint when it's not ready to process a request. That vaguely reminds me of something we fixed in the past.

Flagging for team attention.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Aug 22, 2018
@snicoll snicoll added this to the 2.0.x milestone Aug 22, 2018
@mbhave
Copy link
Contributor

mbhave commented Aug 22, 2018

Possibly the same fix as #12380

@snicoll snicoll assigned snicoll and unassigned snicoll Aug 24, 2018
@snicoll
Copy link
Member

snicoll commented Aug 24, 2018

Potentially but not only. I'd like @wilkinsona to have a look as well.

@wilkinsona
Copy link
Member

I agree with @mbhave's assessment. ApplicationContextServerWebExchangeMatcher needs to be updated to call initialized before assigning this.context and all of its subclasses need to be updated so that any fields that are assigned in initialized are volatile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

5 participants