troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

kind: Preflight with no analyzers shows a misleading error

Open marccampbell opened this issue 5 years ago • 3 comments

With Preflight 0.38, if I run preflight checks and don't include an analyzers section, the error message is:

  Running Preflight checks ⠴ Error: no data has been collected

If Preflights require analyzers, the message should show that. If we can have a better experience with no analyzers, that's even better.

marccampbell avatar Jul 17 '20 22:07 marccampbell

@marccampbell Marc, afaik analyzers and its results are preflight's core, without analyzers it wouldn't make sense to run preflight at all, am I correct? If that is so, the message could be something communicating that to the user, and maybe a couple of links to the docs or to the preflight example to make the user experience better?

manavellamnimble avatar Sep 08 '20 16:09 manavellamnimble

@manavellamnimble the issue is that the default collectors may reference items that aren't required by analyzers.

For example, default collectors includes clusterResources. This attempts to list all namespaces and all objects it has access to. If the only analyzer is "Kubernetes Version", the clusterResources collector is not needed, but still errors.

We should be looking at the collector data used by included analyzers, and not fail on the collect phase for preflight if the analyzers aren't going to consume the collected data that is inaccessible.

marccampbell avatar Sep 08 '20 16:09 marccampbell

@marccampbell Hi Marc, I tested different error-situations, and under normal circumstances, the failure of a collector only affects the correspondent analyzer, meaning that if I would only run the K8s version analyzer and the cluster resources collector fails, I would only be informed through the console failed to run collector cluster-resources: error_msg, but still get the result on the interactive display.

If a specific analyzer fails, the user would be informed through the interactive display in the console. Even if its only one.

So, the problem would be if, for example, when running only k8s version analyzer, the cluster resources collector panics. In that case execution would stop and cluster resources collector was not needed at all.

A solution may be to exclude (using the isExclude-flag?) unnecessary collectors previous to the beginning of the collection fase.

manavellamnimble avatar Sep 09 '20 20:09 manavellamnimble