From 6da6fbff45cc219110564231c38ac84c3049d133 Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Fri, 4 Jun 2021 12:14:28 -0600 Subject: [PATCH] Populate the agent action result if there is no matching action handlers --- .../pipeline/actions/handlers/handler_action_application.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers/handler_action_application.go b/x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers/handler_action_application.go index a8e7b883258e..5a49fdeb1847 100644 --- a/x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers/handler_action_application.go +++ b/x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers/handler_action_application.go @@ -41,7 +41,11 @@ func (h *AppAction) Handle(ctx context.Context, a fleetapi.Action, acker store.F appState, ok := h.srv.FindByInputType(action.InputType) if !ok { - return fmt.Errorf("matching app is not found for action input: %s", action.InputType) + // If the matching action is not found ack the action with the error for action result document + action.StartedAt = time.Now().UTC().Format(time.RFC3339Nano) + action.CompletedAt = action.StartedAt + action.Error = fmt.Sprintf("matching app is not found for action input: %s", action.InputType) + return acker.Ack(ctx, action) } params, err := action.MarshalMap()