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

[BUG] Improper Error Handling #5326

Open
bandinib-amzn opened this issue Oct 19, 2023 · 6 comments · May be fixed by #5345
Open

[BUG] Improper Error Handling #5326

bandinib-amzn opened this issue Oct 19, 2023 · 6 comments · May be fixed by #5345
Labels
bug Something isn't working

Comments

@bandinib-amzn
Copy link
Member

bandinib-amzn commented Oct 19, 2023

Describe the bug

OpenSearch-Dashboards have "Improper Error Handling" when we enter bad string in Visualization search box.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any visualization
  2. In Search box enter jjjjjjj"><><><><img>
  3. Hit Enter
  4. See error

Expected behavior
Proper error handling should be done for such bad input from user. It can be simple string like "Invalid Query" or "Invalid Input" instead of showing the packages which are facing error.

OpenSearch Version
Please list the version of OpenSearch being used.

Dashboards Version
Please list the version of OpenSearch Dashboards being used.

Plugins

Please list all plugins currently enabled.

Screenshots

Screenshot 2023-10-18 at 5 00 48 PM

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Browser and version [e.g. 22]

Additional context

Add any other context about the problem here.

@bandinib-amzn bandinib-amzn added bug Something isn't working untriaged labels Oct 19, 2023
@willie-hung
Copy link
Contributor

I would like to work on this issue. Thanks!

@kgcreative
Copy link
Member

@joshuarrrr, in the dashboards page, the error instead of showing up in a toast, shows up as an "error" state in each visualization. (therwise we'd be firing 20+ toasts)

@joshuarrrr
Copy link
Member

@kgcreative But the error comes from the data plugin (which is responsible for the global DQL/Lucene query bar). So there'd be no particular reason for the visualization panels themselves to fire the toast - the query component should be aware of invalid input (ideally, it would also be nice if it provided live syntax hints as you typed to proactively identify query syntax errors).

Also @ashwin-pc updated the toast system to dedupe via id (see #3752), so we should have no technical limitation on making the behavior consistent across any app that uses the data/query component, even if multiple errors are triggered. So if you'd prefer to have the current app-specific behavior of today, that's fine, but we're not stuck with it if you'd prefer something else.

@kgcreative
Copy link
Member

Ok, with that in mind, i think that makes a lot of sense. We should be able to call out improper filters, and show the same error toast that we have across the application, while deduping where appropriate. I think it still makes sense to show individual errors on the visualizations, but perhaps it should still show the data, disable improperly formatted filters, and show that there are disabled filters in the query. (bascially, ignore errors, display the visualization anyway, with a warning box)

@bandinib-amzn
Copy link
Member Author

Not to scope creep this issue, but it's surprising to me that I can't reproduce on a Dashboard page, such as https://playground.opensearch.org/app/dashboards#/view/c39012d0-eb7a-11ed-8e00-17d7d50cd7b2?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:jjjjjjj%22%3E%3C%3E%3C%3E%3C%3E%3Cimg%3E),timeRestore:!t,title:'Visual%20Consistency%20Dashboard',viewMode:view)

Shouldn't we see this error toast everywhere we use an improperly formatted query?

I think data plugin throws error at this line in src/plugins/data/common/opensearch_query/kuery/ast/ast.ts for invalid search input for both Visualization and Dashboard. This is might be because of how Visualization and Dashboards handled the error. Visualization shows toast and Dashboards shows error badge with error message in tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants