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

Micrometer extension didn't work with the security-oauth2 extension #12029

Closed
loicmathieu opened this issue Sep 10, 2020 · 4 comments · Fixed by #12140
Closed

Micrometer extension didn't work with the security-oauth2 extension #12029

loicmathieu opened this issue Sep 10, 2020 · 4 comments · Fixed by #12140
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@loicmathieu
Copy link
Contributor

loicmathieu commented Sep 10, 2020

Describe the bug
When using micrometer extension and security-oauth2 I have the following exception:

 java.lang.NullPointerException
	at io.quarkus.micrometer.runtime.binder.vertx.MetricsContext.addRoutingContext(MetricsContext.java:44)
	at io.quarkus.micrometer.runtime.binder.vertx.VertxMeterFilter.handle(VertxMeterFilter.java:18)
	at io.quarkus.micrometer.runtime.binder.vertx.VertxMeterFilter.handle(VertxMeterFilter.java:10)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1034)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:131)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
	at io.quarkus.vertx.http.runtime.security.HttpAuthorizer.doPermissionCheck(HttpAuthorizer.java:116)
	at io.quarkus.vertx.http.runtime.security.HttpAuthorizer.checkPermission(HttpAuthorizer.java:99)
	at io.quarkus.vertx.http.runtime.security.HttpSecurityRecorder$3.handle(HttpSecurityRecorder.java:214)
	at io.quarkus.vertx.http.runtime.security.HttpSecurityRecorder$3.handle(HttpSecurityRecorder.java:206)
	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1034)
	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:131)
	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133)
	at io.quarkus.vertx.http.runtime.security.HttpSecurityRecorder$2$2.onItem(HttpSecurityRecorder.java:139)
	at io.quarkus.vertx.http.runtime.security.HttpSecurityRecorder$2$2.onItem(HttpSecurityRecorder.java:100)

The exception didn't occurs if I remove the security extensions.
The exception didn' occurs with smallrye-metrics.

This is the complete list of extensions I use: agroal, cdi, flyway, hibernate-orm, hibernate-orm-panache, hibernate-validator, jaeger, jdbc-postgresql, micrometer, mutiny, narayana-jta, rest-client, resteasy, resteasy-jsonb, security, security-oauth2, security-properties-file, smallrye-context-propagation, smallrye-fault-tolerance, smallrye-health, smallrye-openapi, smallrye-opentracing, swagger-ui

The same issue occurs with security-properties-file so it should occurs on all security extensions.

Adding DEBUG logging on Quarkus shows where the errors comes from:

DEBUG [io.qua.mic.run.bin.ver.VertxMeterFilter] (executor-thread-1) Handling event io.vertx.ext.web.impl.RoutingContextImpl@40da89c3 with context null

The Vert.x Context is null on this line this the NPE: https://github.com/quarkusio/quarkus/blob/master/extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxMeterFilter.java#L15

@loicmathieu loicmathieu added the kind/bug Something isn't working label Sep 10, 2020
@loicmathieu
Copy link
Contributor Author

/cc @ebullient

@loicmathieu loicmathieu changed the title Micrometer extension didn't work when using a security extension Micrometer extension didn't work whit the security-oauth2 extension Sep 10, 2020
@ebullient ebullient self-assigned this Sep 10, 2020
@ebullient
Copy link
Member

Smallrye metrics doesn't instrument Vert.x, so it isn't on this path. I'll have a look.
Thanks!

@loicmathieu loicmathieu changed the title Micrometer extension didn't work whit the security-oauth2 extension Micrometer extension didn't work with the security-oauth2 extension Sep 10, 2020
@gsmet
Copy link
Member

gsmet commented Sep 15, 2020

@ebullient any chance you could have a look soon? I think it's something I would want for 1.8.1 and, considering a few issues I saw, it might be closer than expected (I might release something on Friday).

@ebullient
Copy link
Member

Yes. sorry. distracted w/ kids' school starting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants