Skip to content

[8.15] [Security Solution] [Security Assistant] Fixes an unable to load page error in the Security assistant (#194488)#194506

Merged
kibanamachine merged 1 commit intoelastic:8.15from
kibanamachine:backport/8.15/pr-194488
Oct 1, 2024
Merged

[8.15] [Security Solution] [Security Assistant] Fixes an unable to load page error in the Security assistant (#194488)#194506
kibanamachine merged 1 commit intoelastic:8.15from
kibanamachine:backport/8.15/pr-194488

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.15:

Questions ?

Please refer to the Backport tool documentation

… error in the Security assistant (elastic#194488)

### [Security Solution] [Security Assistant] Fixes an unable to load page error in the Security assistant

This PR fixes an `Unable to load page error` in the Security Assistant, introduced in <elastic#193645>, where a check that appeared to be optional was removed.

- The issue occurs when the assistant is asked a question that is likely to require anonymization, for example: `which alerts should I look at first?`
- After the error occurs, re-opening the assistant for the same conversation may re-trigger the error
- As a workaround, clear Kibana local storage for the current user, or via the browser's dev tools, specifically delete the `elasticAssistantDefault.lastConversationId` setting illustrated by the screenshot below:

![local_storage_key](https://github.com/user-attachments/assets/882f68e2-a253-49d7-84ad-fe2326bbfe20)

### Steps to reproduce

To reproduce:

1) Ask the assistant a question that is likely to cause anonymized alerts to be returned, for example: `which alerts should I look at first?`

**Expected result**

- Anonymized alerts are displayed

**Actual result**

- An `Unable to load page` error is displayed, as illustrated by the screenshot below:

![unable_to_load_page](https://github.com/user-attachments/assets/54006a07-5a79-45d6-97cb-f36e0a71361f)

- The error details include text similar to the output below:

```
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at replaceAnonymizedValuesWithOriginalValues (http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:60965:14)
    at transformMessageWithReplacements (http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:100511:158)
    at transformMessage (http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:100612:41)
    at http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:100638:32
    at Array.map (<anonymous>)
    at getComments (http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:100595:45)
    at http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:68997:15
    at updateMemo (http://localhost:5601/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:369829:19)
    at Object.useMemo (http://localhost:5601/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:370375:16)

The above error occurred in AssistantComponent:
    at AssistantComponent (http://localhost:5601/XXXXXXXXXXXX/bundles/plugin/securitySolution/1.0.0/securitySolution.chunk.lazy_application_dependencies.js:68776:3)
    at div
    at http://localhost:5601/XXXXXXXXXXXX/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:160008:73
    at div
    at http://loc
```

- The following video illustrates the error:

<https://github.com/user-attachments/assets/e96d7ac0-032d-49d6-88be-a8add6547fb1>

(cherry picked from commit 35233ba)
@kibana-ci
Copy link

💚 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 17.2MB 17.2MB +40.0B

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

cc @andrew-goldstein

@kibanamachine kibanamachine merged commit 362672f into elastic:8.15 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants