-
Notifications
You must be signed in to change notification settings - Fork 1k
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 io.micrometer.common.KeyValues #3849
Comments
Thank you for the report. Could you please provide a minimal sample java project to reproduce this issue so we can more easily investigate and ensure any fix is working properly for your use case? I was able to reproduce two issues through
But I was not able to reproduce it through the Observation API (your use-case). It seems Spring Security somehow manages to add a |
Thank you for the quick response. I will strip up one of the apps to provide a sample, in parallel I will also create an issue with Spring Security. Best regards, |
I have created a stripped up sample project. In our production environment we query the /actuator/prometheus endpoint every 20 seconds. |
This project is not really minimal and if I strip it down further, I'm not able to reproduce the issue, could you please give us a minimal sample java project? Also, the details that were in the template when you opened the issue (environment, repro steps) would be useful too, could you please include those as well to ensure I'm using the same java version (and vendor) as well as I follow the same repro steps (I checked the actuator endpoints including prometheus)? |
I removed those plugins and also lombok. Java: 17.0.7+7 (Bellsoft) In our environment we see this exception from time to time in our logs, while Prometheus is calling every 20 seconds the /actuator/prometheus endpoint. The actuator is secured with basic auth and the credentials you can find in the application.yml. |
I'm sorry but I'm not sure the situation is much better. :( Also, could you please take a look at the issue template? It asks for a bit more extra details than the java version. Btw my Java version is quite similar (Liberica/BellSoft 17.0.6), once the reproducer is minimal, I'm going to retry it with the exact same version. This is what I did after the cleanup:
You wrote that you see the exception in prod from time to time, could you please help me with two things?
|
Sorry for the delay. Regrading the sample, I'm not sure what you have in mind to further reduce. The sample contains only three classes. I assume you like to get rid of the Spring Boot and maybe replace by Spring Framework directly, but as this is in the context of Spring Security and this is configured via the auto configurer it would take me some time and not sure if that helps finally. Alex PS: On the issue I opened for Spring Security there was the request to test with a newer Spring Security 6.0.4 snapshot version. So, seems they have already changed/fixed something in their code. |
It's not about the number of classes (though I think
No, not at all, Boot is completely fine (see what I meant above).
Oh, I definitely did not send that many (though isn't it closer to (24 * 60 * 4) * (5 * 4) / 7 ~= 16+k?). That might explain why I was not able to reproduce it. With this application, were you able to repro the issue in your local dev environment? I assumed yes and since I was not able to, I got confused.
This makes sense, the instrumentation is different for web and webflux so you can run into issues that is specific to one stack (webflux is much harder).
Thank you, I subscribed to the issue, what Josh saying about the concurrency issue makes sense to me, if upgrading fixes it, I will talk to him to find out how is it possible to cause such NPE on Micrometer side (we need to fix that too). |
Hello @jonatan-ivanov / Everyone! Is there any solution for the issue in discussion? I'm facing a similar issue when migrating Spring Boot 2 to 3. Can anyone let me know the probable fix. 2024-01-04 16:48:45,895[${sys:domain},/] 2024-01-04 16:48:45,895[] ERROR [scheduling-1] support.TaskUtils$LoggingErrorHandler (TaskUtils.java:95) - Unexpected error occurred in scheduled task |
Hi @maheshtallada, we are using 3.1.7 right now and with that version we don't see the NPE any longer. Actually there were some fixes in Spring Security that have resolved the issue. |
Hi @dietzsch, Thanks for the info. However in my case, it doesn't seem to occur because of Spring Security. 2024-01-04 18:09:12,002[${sys:domain},/] 2024-01-04 18:09:12,002[] ERROR [scheduling-1] support.TaskUtils$LoggingErrorHandler (TaskUtils.java:95) - Unexpected error occurred in scheduled task Here's the dependency tree. [�[1;34mINFO�[m] com..chub:sms-integration-api:jar:0.0.1-SNAPSHOT |
@maheshtallada this might be an issue with the instrumentation of |
It might be already done in spring-projects/spring-framework#31918 |
Hello,
we have a set of Java Spring Boot applications, that we updated today to version 3.0.7. For monitoring the applications we have added dependency "io.micrometer:micrometer-registry-prometheus" to get the additional prometheus actuator. For all the Spring Boot apps that are running on the Webflux stack - use Netty - we see from time to time the following error in the logs:
The text was updated successfully, but these errors were encountered: