Skip to content

Conversation

@michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Oct 31, 2025

When enrollment fails it retries indefinitely. This is fine when triggered from CLI but when running from Action it can lead to confusing outcomes (e.g Migration never finishes)

This PR addresses this in 2 ways
First it sets 3 retries for action triggered enrollments
Second it handles 401 as something that we should not retry on.

Previously indefinitely in agent activity
image

With fix:
image

Fixes: #10909

@michalpristas michalpristas self-assigned this Oct 31, 2025
@michalpristas michalpristas requested a review from a team as a code owner October 31, 2025 12:36
@michalpristas michalpristas added the Team:Elastic-Agent Label for the Agent team label Oct 31, 2025
@michalpristas michalpristas added skip-changelog backport-9.2 Automated backport to the 9.2 branch labels Oct 31, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Oct 31, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @michalpristas

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding the unit tests <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.2 Automated backport to the 9.2 branch skip-changelog Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] Invalid token causes agent migration to hang and block new attempts

4 participants