Skip to content

[Entity Analytics] [bug-fix] Do not abort risk score search request#219858

Merged
machadoum merged 3 commits intoelastic:mainfrom
hop-dev:219490-abort-error-on-asset-crit-cha
May 6, 2025
Merged

[Entity Analytics] [bug-fix] Do not abort risk score search request#219858
machadoum merged 3 commits intoelastic:mainfrom
hop-dev:219490-abort-error-on-asset-crit-cha

Conversation

@hop-dev
Copy link
Contributor

@hop-dev hop-dev commented May 1, 2025

Summary

Closes #219490

Fix an error toast appearing when changing an entities asset criticality from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating the error toast.

  • Do not toast if an abort error is thrown
  • Do not abort the request unless the component receives skip:true

Test Steps

  1. Use the security document generator yarn start entity-store command to load entities and enable the risk engine
  2. Enable the entity store
  3. from the entities table open the entity flyout
  4. Assign/change asset criticality
  5. observe the error is not present

Why did the bug happen?

The risk score component stops rendering because the conditions for aborting and searching differ. So we aborted the HTTP call but didn't search again.

I believe this PR #201810 introduced the bug

@hop-dev hop-dev added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Entity Analytics Security Entity Analytics Team v9.1.0 labels May 1, 2025
@prodsecmachine
Copy link
Collaborator

prodsecmachine commented May 1, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@machadoum machadoum force-pushed the 219490-abort-error-on-asset-crit-cha branch from 6450b4e to 85d2eab Compare May 2, 2025 10:07
@machadoum machadoum changed the title [Entity Analytics] Do not abort risk score search request if risk engine status is loading [Entity Analytics] [bug-fix] Do not abort risk score search request May 2, 2025
@machadoum machadoum added the bug Fixes for quality problems that affect the customer experience label May 2, 2025
@machadoum machadoum marked this pull request as ready for review May 2, 2025 10:13
@machadoum machadoum requested review from a team as code owners May 2, 2025 10:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

Copy link
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

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

Desk tested: output below, error gone 🚀 . Thanks Mark and Pablo! 🎉

image

@hop-dev hop-dev added backport:version Backport to applied version labels backport:prev-minor v9.0.2 release_note:fix and removed backport:skip This PR does not require backporting backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes labels May 6, 2025
@machadoum machadoum enabled auto-merge (squash) May 6, 2025 08:58
@machadoum machadoum merged commit 64d20bb into elastic:main May 6, 2025
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.0

https://github.com/elastic/kibana/actions/runs/14855773125

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 9.1MB 9.1MB +53.0B

History

cc @machadoum @hop-dev

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 6, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
(cherry picked from commit 64d20bb)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.0

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 8, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

10 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @machadoum

kibanamachine added a commit that referenced this pull request May 23, 2025
…uest (#219858) (#220209)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Entity Analytics] [bug-fix] Do not abort risk score search request
(#219858)](#219858)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2025-05-06T09:04:02Z","message":"[Entity
Analytics] [bug-fix] Do not abort risk score search request
(#219858)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/219490\n\nFix an error toast
appearing when changing an entities asset criticality\nfrom the entity
flyout. See video on issue above for more detail.\n\nWe were seeing the
risk score request be aborted and this was creating\nthe error
toast.\n\n- Do not toast if an abort error is thrown\n- Do not abort the
request unless the component receives `skip:true`\n\n### Test
Steps\n\n1. Use the security document generator `yarn start
entity-store` command\nto load entities and enable the risk engine\n2.
Enable the entity store\n3. from the entities table open the entity
flyout\n4. Assign/change asset criticality\n5. observe the error is not
present\n\n### Why did the bug happen?\nThe risk score component stops
rendering because the conditions for\naborting and searching differ. So
we aborted the HTTP call but didn't\nsearch again.\n\nI believe this PR
https://github.com/elastic/kibana/pull/201810\nintroduced the
bug\n\n---------\n\nCo-authored-by: machadoum
<pablo.nevesmachado@elastic.co>","sha":"64d20bb00b9e314c9abe257c8453c2684bccc0a3","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:prev-minor","Team:Entity
Analytics","v9.1.0","v9.0.2"],"title":"[Entity Analytics] [bug-fix] Do
not abort risk score search
request","number":219858,"url":"https://github.com/elastic/kibana/pull/219858","mergeCommit":{"message":"[Entity
Analytics] [bug-fix] Do not abort risk score search request
(#219858)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/219490\n\nFix an error toast
appearing when changing an entities asset criticality\nfrom the entity
flyout. See video on issue above for more detail.\n\nWe were seeing the
risk score request be aborted and this was creating\nthe error
toast.\n\n- Do not toast if an abort error is thrown\n- Do not abort the
request unless the component receives `skip:true`\n\n### Test
Steps\n\n1. Use the security document generator `yarn start
entity-store` command\nto load entities and enable the risk engine\n2.
Enable the entity store\n3. from the entities table open the entity
flyout\n4. Assign/change asset criticality\n5. observe the error is not
present\n\n### Why did the bug happen?\nThe risk score component stops
rendering because the conditions for\naborting and searching differ. So
we aborted the HTTP call but didn't\nsearch again.\n\nI believe this PR
https://github.com/elastic/kibana/pull/201810\nintroduced the
bug\n\n---------\n\nCo-authored-by: machadoum
<pablo.nevesmachado@elastic.co>","sha":"64d20bb00b9e314c9abe257c8453c2684bccc0a3"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219858","number":219858,"mergeCommit":{"message":"[Entity
Analytics] [bug-fix] Do not abort risk score search request
(#219858)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/219490\n\nFix an error toast
appearing when changing an entities asset criticality\nfrom the entity
flyout. See video on issue above for more detail.\n\nWe were seeing the
risk score request be aborted and this was creating\nthe error
toast.\n\n- Do not toast if an abort error is thrown\n- Do not abort the
request unless the component receives `skip:true`\n\n### Test
Steps\n\n1. Use the security document generator `yarn start
entity-store` command\nto load entities and enable the risk engine\n2.
Enable the entity store\n3. from the entities table open the entity
flyout\n4. Assign/change asset criticality\n5. observe the error is not
present\n\n### Why did the bug happen?\nThe risk score component stops
rendering because the conditions for\naborting and searching differ. So
we aborted the HTTP call but didn't\nsearch again.\n\nI believe this PR
https://github.com/elastic/kibana/pull/201810\nintroduced the
bug\n\n---------\n\nCo-authored-by: machadoum
<pablo.nevesmachado@elastic.co>","sha":"64d20bb00b9e314c9abe257c8453c2684bccc0a3"}},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 23, 2025
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…lastic#219858)

## Summary

Closes elastic#219490

Fix an error toast appearing when changing an entities asset criticality
from the entity flyout. See video on issue above for more detail.

We were seeing the risk score request be aborted and this was creating
the error toast.

- Do not toast if an abort error is thrown
- Do not abort the request unless the component receives `skip:true`

### Test Steps

1. Use the security document generator `yarn start entity-store` command
to load entities and enable the risk engine
2. Enable the entity store
3. from the entities table open the entity flyout
4. Assign/change asset criticality
5. observe the error is not present

### Why did the bug happen?
The risk score component stops rendering because the conditions for
aborting and searching differ. So we aborted the HTTP call but didn't
search again.

I believe this PR elastic#201810
introduced the bug

---------

Co-authored-by: machadoum <pablo.nevesmachado@elastic.co>
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 release_note:fix Team:Entity Analytics Security Entity Analytics Team v9.0.2 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security Solution] [Bug] Getting Failed to run search on risk score on assigning Asset Criticality to Entities

6 participants