Describe the bug When hitting an oath2 resource server secured endpoint while micrometer is recording trace spans and Reactor has automatic context propagation enabled, an exception is thrown and a 500 is returned to the caller.
To Reproduce Follow the steps outlined in the README of https://github.com/zoobert/reactor-failure
Expected behavior A 200 response to be returned for an authenticated call to the server.
Sample
https://github.com/zoobert/reactor-failure
This is related to fixes made to Spring Boot 3.1.1 (soon to be released). It was initially reported in Project Reactor as related to #3499 and originally found when applying the advice from #3916 in Micrometer.
Comment From: jzheaux
Thanks for the report, @zoobert.
I was able to isolate the issue to WebClient. I've updated your sample in a PR to exclude Spring Security and add a controller method that requests the https://dev-ymp8imynkijzas0o.us.auth0.com/.well-known/jwks.json endpoint.
@bclozel, at this point is Spring Framework the best place to continue investigating this issue?
Comment From: bclozel
I have updated the sample to Spring Boot 3.1.2-SNAPSHOT and the error goes away. I think this is related to https://github.com/micrometer-metrics/micrometer/issues/3943 which was fixed in 1.11.2.
I confirmed that by setting the Spring Boot version in the sample to 3.1.1 and overriding the Micrometer version to ext.set("micrometer.version", "1.11.2") - the error is still gone. I think this issue can be closed as a duplicate of the Micrometer issue.
Comment From: jzheaux
Closing in favor of https://github.com/micrometer-metrics/micrometer/issues/3943