Skip to content

[Framework bug] Fleet policy changes are not handled correctly, restart required to "sync" state #2992

@jedrazb

Description

@jedrazb

Bug Description

If we change the connector id in fleet policy, e.g.

from connector xd-123 to xd-456

Image

Image

the agent component will detect this change correctly, but since the only input has been change we will only receive delta event from checkin agent protocol call, see:

Image

We are not receiving any (net new) ES output, so our logic disregards this update and doesn't update config, nor create the new connector doc with new ID. This because we always assume to receive new ES output in update https://github.com/elastic/connectors/blob/main/connectors/agent/protocol.py#L134

If we restart the agent component stuff works fine (and we end up creating xd-456 connector)

[elastic_agent.python_elastic_agent_client][info] Connector input found. Service type: google_drive, Connector ID: xd-456, Connector Name: Google Drive Custom ID
11:24:32.893
elastic_agent.python_elastic_agent_client
connectors-py-default
[elastic_agent.python_elastic_agent_client][warning] No Elasticsearch output found

To Reproduce

Steps to reproduce the behavior:

  1. Create agentless connector policy with connector id defined
  2. It should create a connector with this id
  3. Update policy with new connector id
  4. No new connector created
  5. Restart the agent
  6. New connector created as expected

TO do

Make it work with delta updates of policy

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions