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

Spring Admin UI is flooded with "Request failed" error toasts when EVCache size is null #2178

Closed
iuliiasobolevska opened this issue Dec 9, 2022 · 4 comments
Labels

Comments

@iuliiasobolevska
Copy link
Contributor

Spring Boot Admin Server information

  • Version:
    2.7.7

  • Spring Boot version:
    2.7.5

  • Webflux or Servlet application:
    Webflux

Description

Spring Boot Admin shows an increased number of error toasts when cache.size metric is absent after updating to version 2.7.7.
This is a result of the change made in 330252c that surfaces errors that were previously swallowed.

Root cause

Micrometer doesn't emit cache.size metric when EVCache size() method returns null:

but Spring Admin expects metric to be present:

showing a "Request failed" toast with the following error in the console when response is undefined:

Fetching cache EVCACHE_TEST size failed - error is ignored TypeError: Cannot read properties of undefined (reading 'data')
    at details-cache.vue:131:1
    at l (runtime.js:63:40)
    at Generator._invoke (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at r (asyncToGenerator.js:3:20)
    at s (asyncToGenerator.js:25:9)

Unfortunately, I don't have a screenshot right now but the first time the issue was observed the whole screen was flooded with error toasts which is surprising given that shouldFetchCacheSize should get set to false when the 1st issue is observed:

Potential solutions

I'm happy to submit a PR if you support the suggestion to handle response being undefined in a way that would disable further cache.size retrieval and do not show error toast at all (even for the 1st error) to not confuse customers.

@SteKoe
Copy link
Contributor

SteKoe commented Dec 10, 2022

Hi,

we have just released version 2.7.9 of SBA that includes a property to enable toasts spring.boot.admin.ui.enable-toasts. They are disabled by default, now.
We hope that this reduces the confusion.

@SteKoe SteKoe closed this as completed Dec 10, 2022
@iuliiasobolevska
Copy link
Contributor Author

Appreciate the prompt response. What I was trying to point out is that it's totally valid for cache.size metric to not be emitted and Spring Admin doesn't respect that and as a result breaks contract. Disabling error toasts would hide the issue and as you pointed out would confuse customers less but it doesn't feel like the right fix. Apologies for not clearly explaining what I think the issue is about.

@iuliiasobolevska
Copy link
Contributor Author

@SteKoe, I would appreciate your thoughts on my last comment and wondering this issue should be reopened.

@SteKoe
Copy link
Contributor

SteKoe commented Dec 16, 2022

Hi @iuliiasobolevska,

sorry for closing the issue, we would love to see a PR fixing the issue in the frontend! :)

Kind regards
SteKoe

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

No branches or pull requests

3 participants