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

autocomplete service returns 500 internal server error when given indexes that do not exist #104974

Closed
FrankHassanabad opened this issue Jul 8, 2021 · 1 comment · Fixed by #106220
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Filters Feature:KQL KQL impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort v7.14.0

Comments

@FrankHassanabad
Copy link
Contributor

Describe the bug:
When you hit the autocomplete service within Kibana using either kibana.yml strategies of:

data.autocomplete.valueSuggestions.method: 'terms_agg'

or the newer default one (from #100174)

data.autocomplete.valueSuggestions.method: 'terms_enum'

You get back a 500 internal service error:

server   error  [13:55:37.767]  Error: Internal Server Error
    at HapiResponseAdapter.toInternalError (/Users/frankhassanabad/projects/kibana/src/core/server/http/router/response_adapter.ts:53:19)
    at Router.handle (/Users/frankhassanabad/projects/kibana/src/core/server/http/router/router.ts:287:34)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at handler (/Users/frankhassanabad/projects/kibana/src/core/server/http/router/router.ts:228:11)
    at exports.Manager.execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
    at Object.internals.handler (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at exports.execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at Request._lifecycle (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/request.js:370:32)
    at Request._execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/request.js:279:9)

Steps to reproduce:
Use a CURL script to hit the service with a non-existent index such as:

# Blows up with 500 error if given nonexistent index
curl -s -k \
  -H 'Content-Type: application/json' \
  -H 'kbn-xsrf: 123' \
  -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \
  -X POST ${KIBANA_URL}/api/kibana/suggestions/values/index-does-not-exist \
  --data-raw '{"query":"","field":"host.name","filters":[]}'

# Error returned
# {"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred."}%

Expected behavior:
Errors from Elasticsearch such as 404 not found would be bubbled up as nice REST API semantics of a wrapped 404 error and that REST services do not return 500 internal server errors.

Kibana version:
7.14.0 BC-1, 8.0.0

Elasticsearch version:
7.14.0 BC-1, 8.0.0

@FrankHassanabad FrankHassanabad added bug Fixes for quality problems that affect the customer experience Feature:Filters Feature:KQL KQL Team:AppServices v7.14.0 labels Jul 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@FrankHassanabad FrankHassanabad changed the title 500 internal service error when autocomplete service is given indexes that do not exist autocomplete service returns 500 internal server error when given indexes that do not exist Jul 8, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort impact:critical This issue should be addressed immediately due to a critical level of impact on the product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Jul 13, 2021
@lukasolson lukasolson added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:critical This issue should be addressed immediately due to a critical level of impact on the product. labels Jul 14, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Filters Feature:KQL KQL impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort v7.14.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants