From 9997dabf90f3dd36c0577a8d6f6e10dd5dc88054 Mon Sep 17 00:00:00 2001 From: Mark Hopkin Date: Wed, 4 Dec 2024 14:06:56 +0000 Subject: [PATCH] [Entity Analytics][Entity Store] Clear error on second entity engine init API call (#202903) ## Summary If the first call to init an entity engine fails, we add the `error` property to the engine status, if we then call the API a second time this error was not being wiped. This PR resets the error on the second call. ### Test steps - Do not visit the UI of a kibana so that the security default data view does not exist - Call the init API for an entity engine e,g host - Call the engine status API, notice the status has an error - Visait the security solution UI and wait for the data view to be created - Re-call the init API and notice the error has gone --- .../entity_store/saved_object/engine_descriptor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts index cfaea1b1da0ff..a3c7a7d0266a1 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts @@ -49,6 +49,7 @@ export class EngineDescriptorClient { const old = engineDescriptor.saved_objects[0].attributes; const update = { ...old, + error: undefined, // if the engine is being re-initialized, clear any previous error status: ENGINE_STATUS.INSTALLING, filter, fieldHistoryLength,