Issue 25323: Fixed error catch and route handling v2#44800
Issue 25323: Fixed error catch and route handling v2#44800igoristic merged 14 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/stack-monitoring |
💔 Build Failed |
chrisronline
left a comment
There was a problem hiding this comment.
Overall, this is great! I really like how you decided to convert the no-data page to use the standard BaseController logic!
| if (catchReason) { | ||
| this.reason = catchReason; | ||
| } else if (!this.isCollectionEnabledUpdating | ||
| && !this.isCollectionEnabledUpdated |
There was a problem hiding this comment.
So I was working through the process of enabling monitoring while having some misconfigurations in my cluster settings. For example, I had monitoring disabled, but I also had a local exporter configured that was also disabled (a local exporter disabled will show an error on this page). When I clicked the blue button to enable monitoring, the spinner never left, but after some debugging I realized it was because this.isCollectionEnabledUpdated was set to true and never reset.
I don't know if the right change is to remove this line from the conditional, or maybe look into how it's mutated to understand if a change is necessary there, but I think we can do a little more to make a more seamless UX.
There was a problem hiding this comment.
Looks like it's only set in the catch but never reseted:
I will set it to false before the async function here:
There was a problem hiding this comment.
I don't think this solution quite works. I'm not seeing a change in behavior on my side. It's still stuck on true which is preventing the next startChecks() call
There was a problem hiding this comment.
Maybe we're testing different scenarios. What steps are taking to reproduce the sticky loading phase?
There was a problem hiding this comment.
Sure, so start off with a cluster that has no monitoring data and does not have monitoring enabled. Go to the dev tools and configure a local or remote exporter that is disabled, something like:
PUT _cluster/settings
{
"transient": {
"xpack.monitoring.exporters": {
"my_remote": {
"type": "http",
"enabled": false
}
}
}
}
Go to the monitoring UI, see the blue enable button, and click it. My experience is it just keeps spinning and never shows me the next error (which is that all my exporters are disabled).
This is where I found the list of scenarios that would cause an error message: https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch_settings/find_reason.js
There was a problem hiding this comment.
Actually I think the best solution would be to remove that if condition, and just let the checks happen
@chrisronline What do you think?
There was a problem hiding this comment.
Sounds good to me as long as it solves this problem and doesn't introduce any additional issues, 👍
x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/monitoring/public/views/no_data/controller.js
Outdated
Show resolved
Hide resolved
💔 Build Failed |
chrisronline
left a comment
There was a problem hiding this comment.
I'm seeing an issue with the one of the earlier pieces of feedback. See #44800 (comment)
💔 Build Failed |
chrisronline
left a comment
There was a problem hiding this comment.
Looking great! I had a couple of questions and one request. Thanks!
|
|
||
| import Boom from 'boom'; | ||
|
|
||
| export async function verifyCcsAvailability(req) { |
There was a problem hiding this comment.
Can we add a test for this functionality? Verify it works as expected, verify it works despite the value of skip_unavailable?
There was a problem hiding this comment.
I don't think this test will be very useful, since we don't have any skip_unavailable conditions/logic here.
The only test that makes sense to me is around getData in https://github.com/elastic/kibana/pull/44800/files#diff-87ec11d43f1e502792408786cf726eb6R32 and different states/reasons it could yield. WDYT?
There was a problem hiding this comment.
I guess I was thinking a test for this because I had the thought to add a .skip_unavailable check, which you correctly mentioned was not necessary and would actually cause a problem. I don't feel strongly about it either way - just a thought
x-pack/legacy/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.js
Show resolved
Hide resolved
💚 Build Succeeded |
💚 Build Succeeded |
* Sample version * Add to this page too * Added base class and fixed some race conditions * Addressed code review feedback * Fixed sticky loading state * Fixed unit tests
This is the second attempt, since my first iteration #43338 touched too many different aspects of the app.
Resolves #25323
In some cases we weren't catching

monitoringClustersfailures which resulted in a blank error screen:I also removed some on route
resolvetriggers, since their controllers were already doing that same loading/logicSteps to cause
monitoringClusters()to timeout (onmaster):/no-datafor about 30 seconds with a completely blank screen. After that you'll see a toast error that'll go away, but the blank screen will still be there