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

[Entity Analytics][Entity Store] Init: Put engine in error state if data view does not exist #201140

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Nov 21, 2024

Summary

Fixes a bug where if the securite default data view does not exist the entity engine would get stuck in 'installing' status. After this fix, the engine is put into 'error' state.

The entity engine uses the security default data view by default to generate it's source index pattern.

Testing

  1. Delete the security default data view security-solution-default
  2. Init the entity store
  3. Observe that the entity store is in an error state (the UI should show the error)

@hop-dev hop-dev added release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v8.17.0 v8.18.0 v8.16.2 labels Nov 21, 2024
@hop-dev hop-dev self-assigned this Nov 21, 2024
@hop-dev hop-dev requested a review from a team as a code owner November 21, 2024 12:22
@hop-dev hop-dev requested a review from tiansivive November 21, 2024 12:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

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

@@ -241,19 +241,19 @@ export class EntityStoreDataClient {
) {
const setupStartTime = moment().utc().toISOString();
const { logger, namespace, appClient, dataViewsService } = this.options;
const indexPatterns = await buildIndexPatterns(namespace, appClient, dataViewsService);
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the fix, move the try higher :D

Copy link
Contributor

Choose a reason for hiding this comment

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

uuugh, this is why i dont like try/catch blocks!
I remember fixing an issue a couple weeks back caused by the exact same thing

Copy link
Contributor

@tiansivive tiansivive left a comment

Choose a reason for hiding this comment

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

Tested locally, seems to be working well! Awesome stuff!
Approving, but build is failing, looks like it's related to the test changes in this PR

@hop-dev
Copy link
Contributor Author

hop-dev commented Nov 22, 2024

@elasticmachine merge upstream

@hop-dev hop-dev enabled auto-merge (squash) November 22, 2024 13:20
@hop-dev hop-dev merged commit c3c872c into elastic:main Nov 22, 2024
44 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #11 / MultipleAgentPolicySummaryLine it should render the first policy name and the badge when there are multiple policies

Metrics [docs]

✅ unchanged

History

cc @hop-dev

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2024
…ata view does not exist (elastic#201140)

## Summary

Fixes a bug where if the securite default data view does not exist the
entity engine would get stuck in 'installing' status. After this fix,
the engine is put into 'error' state.

The entity engine uses the security default data view by default to
generate it's source index pattern.

## Testing

1. Delete the security default data view `security-solution-default`
2. Init the entity store
3. Observe that the entity store is in an error state (the UI should
show the error)

(cherry picked from commit c3c872c)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.x

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 201140

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 22, 2024
…e if data view does not exist (#201140) (#201414)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Entity Analytics][Entity Store] Init: Put engine in error state if
data view does not exist
(#201140)](#201140)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-22T15:09:23Z","message":"[Entity
Analytics][Entity Store] Init: Put engine in error state if data view
does not exist (#201140)\n\n## Summary\n\nFixes a bug where if the
securite default data view does not exist the\nentity engine would get
stuck in 'installing' status. After this fix,\nthe engine is put into
'error' state.\n\nThe entity engine uses the security default data view
by default to\ngenerate it's source index pattern.\n\n## Testing\n\n1.
Delete the security default data view `security-solution-default`\n2.
Init the entity store\n3. Observe that the entity store is in an error
state (the UI should\nshow the
error)","sha":"c3c872c6da7ca1cf3fd90ef13ce6ae758c53c9e8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Entity
Analytics][Entity Store] Init: Put engine in error state if data view
does not
exist","number":201140,"url":"https://github.com/elastic/kibana/pull/201140","mergeCommit":{"message":"[Entity
Analytics][Entity Store] Init: Put engine in error state if data view
does not exist (#201140)\n\n## Summary\n\nFixes a bug where if the
securite default data view does not exist the\nentity engine would get
stuck in 'installing' status. After this fix,\nthe engine is put into
'error' state.\n\nThe entity engine uses the security default data view
by default to\ngenerate it's source index pattern.\n\n## Testing\n\n1.
Delete the security default data view `security-solution-default`\n2.
Init the entity store\n3. Observe that the entity store is in an error
state (the UI should\nshow the
error)","sha":"c3c872c6da7ca1cf3fd90ef13ce6ae758c53c9e8"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201140","number":201140,"mergeCommit":{"message":"[Entity
Analytics][Entity Store] Init: Put engine in error state if data view
does not exist (#201140)\n\n## Summary\n\nFixes a bug where if the
securite default data view does not exist the\nentity engine would get
stuck in 'installing' status. After this fix,\nthe engine is put into
'error' state.\n\nThe entity engine uses the security default data view
by default to\ngenerate it's source index pattern.\n\n## Testing\n\n1.
Delete the security default data view `security-solution-default`\n2.
Init the entity store\n3. Observe that the entity store is in an error
state (the UI should\nshow the
error)","sha":"c3c872c6da7ca1cf3fd90ef13ce6ae758c53c9e8"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…ata view does not exist (elastic#201140)

## Summary

Fixes a bug where if the securite default data view does not exist the
entity engine would get stuck in 'installing' status. After this fix,
the engine is put into 'error' state.

The entity engine uses the security default data view by default to
generate it's source index pattern.

## Testing

1. Delete the security default data view `security-solution-default`
2. Init the entity store
3. Observe that the entity store is in an error state (the UI should
show the error)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…ata view does not exist (elastic#201140)

## Summary

Fixes a bug where if the securite default data view does not exist the
entity engine would get stuck in 'installing' status. After this fix,
the engine is put into 'error' state.

The entity engine uses the security default data view by default to
generate it's source index pattern.

## Testing

1. Delete the security default data view `security-solution-default`
2. Init the entity store
3. Observe that the entity store is in an error state (the UI should
show the error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:fix Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.2 v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants