Skip to content

[Enterprise Search]Add 404 error handling for mappings and documents endpoints#161203

Merged
efegurkan merged 1 commit intoelastic:mainfrom
efegurkan:404-from-mappings
Jul 5, 2023
Merged

[Enterprise Search]Add 404 error handling for mappings and documents endpoints#161203
efegurkan merged 1 commit intoelastic:mainfrom
efegurkan:404-from-mappings

Conversation

@efegurkan
Copy link
Copy Markdown
Member

@efegurkan efegurkan commented Jul 4, 2023

Summary

Add 404 handler for the Document and mappings endpoints. They were default handlers before and returning 502. Error message is much more meaningful at the moment.
Screenshot 2023-07-04 at 18 16 53
Screenshot 2023-07-04 at 18 17 01

Checklist

Delete any items that are not applicable to this PR.

@efegurkan efegurkan added release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.9.0 v8.10.0 labels Jul 4, 2023
@efegurkan efegurkan requested a review from a team July 4, 2023 16:20
@efegurkan efegurkan enabled auto-merge (squash) July 4, 2023 16:26
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
enterpriseSearch 10 9 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.5MB 2.5MB -36.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
enterpriseSearch 38.0KB 38.1KB +58.0B
Unknown metric groups

API count

id before after diff
enterpriseSearch 10 9 -1

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 410 414 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 489 493 +4
total +6

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

if (isIndexNotFoundException(error)) {
return createError({
errorCode: ErrorCode.INDEX_NOT_FOUND,
message: 'Could not found index',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilst its not everywhere, we typically localise the error message here, especially if presented to the user. Also message could be better: "Index does not exist".

Copy link
Copy Markdown
Member

@joemcelroy joemcelroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving with one nit

@efegurkan efegurkan merged commit e654c8e into elastic:main Jul 5, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 5, 2023
…endpoints (elastic#161203)

## Summary

Add 404 handler for the Document and mappings endpoints. They were
default handlers before and returning 502. Error message is much more
meaningful at the moment.
![Screenshot 2023-07-04 at 18 16
53](https://github.com/elastic/kibana/assets/1410658/f595391b-2889-4370-907f-7e5c0d331f2c)
![Screenshot 2023-07-04 at 18 17
01](https://github.com/elastic/kibana/assets/1410658/018d34d1-273a-4d85-9f5a-78bbf15cf526)

### Checklist

Delete any items that are not applicable to this PR.

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit e654c8e)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 5, 2023
…ments endpoints (#161203) (#161234)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Enterprise Search]Add 404 error handling for mappings and documents
endpoints (#161203)](#161203)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Efe Gürkan
YALAMAN","email":"efeguerkan.yalaman@elastic.co"},"sourceCommit":{"committedDate":"2023-07-05T08:38:55Z","message":"[Enterprise
Search]Add 404 error handling for mappings and documents endpoints
(#161203)\n\n## Summary\r\n\r\nAdd 404 handler for the Document and
mappings endpoints. They were\r\ndefault handlers before and returning
502. Error message is much more\r\nmeaningful at the
moment.\r\n![Screenshot 2023-07-04 at 18
16\r\n53](https://github.com/elastic/kibana/assets/1410658/f595391b-2889-4370-907f-7e5c0d331f2c)\r\n![Screenshot
2023-07-04 at 18
17\r\n01](https://github.com/elastic/kibana/assets/1410658/018d34d1-273a-4d85-9f5a-78bbf15cf526)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"e654c8e936853e1952b2f46b862fd34911618d74","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.9.0","v8.10.0"],"number":161203,"url":"https://github.com/elastic/kibana/pull/161203","mergeCommit":{"message":"[Enterprise
Search]Add 404 error handling for mappings and documents endpoints
(#161203)\n\n## Summary\r\n\r\nAdd 404 handler for the Document and
mappings endpoints. They were\r\ndefault handlers before and returning
502. Error message is much more\r\nmeaningful at the
moment.\r\n![Screenshot 2023-07-04 at 18
16\r\n53](https://github.com/elastic/kibana/assets/1410658/f595391b-2889-4370-907f-7e5c0d331f2c)\r\n![Screenshot
2023-07-04 at 18
17\r\n01](https://github.com/elastic/kibana/assets/1410658/018d34d1-273a-4d85-9f5a-78bbf15cf526)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"e654c8e936853e1952b2f46b862fd34911618d74"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161203","number":161203,"mergeCommit":{"message":"[Enterprise
Search]Add 404 error handling for mappings and documents endpoints
(#161203)\n\n## Summary\r\n\r\nAdd 404 handler for the Document and
mappings endpoints. They were\r\ndefault handlers before and returning
502. Error message is much more\r\nmeaningful at the
moment.\r\n![Screenshot 2023-07-04 at 18
16\r\n53](https://github.com/elastic/kibana/assets/1410658/f595391b-2889-4370-907f-7e5c0d331f2c)\r\n![Screenshot
2023-07-04 at 18
17\r\n01](https://github.com/elastic/kibana/assets/1410658/018d34d1-273a-4d85-9f5a-78bbf15cf526)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"e654c8e936853e1952b2f46b862fd34911618d74"}}]}]
BACKPORT-->

Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
@efegurkan efegurkan deleted the 404-from-mappings branch October 26, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.9.0 v8.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants