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

Agent does not show upgrade details UPG_SCHEDULED after restart #3913

Open
AndersonQ opened this issue Dec 14, 2023 · 3 comments
Open

Agent does not show upgrade details UPG_SCHEDULED after restart #3913

AndersonQ opened this issue Dec 14, 2023 · 3 comments
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@AndersonQ
Copy link
Member

AndersonQ commented Dec 14, 2023

For confirmed bugs, please report:

  • Version: 8.12/main
  • Operating System: all
  • Discuss Forum URL: N/A
  • Steps to Reproduce:
    • schedule and upgrade on fleet for 2 min form now
    • check the agent report the upgrade is scheduled
    • restart the agent
    • the status will not show upgrade details UPG_SCHEDULED anymore
    • then after the 2 min has passed, the upgrade will start and fail due to this bug

The logic to set the upgrade details for scheduled upgrades is on the action dispatcher:

// Dispatch dispatches an action using pre-registered set of handlers.
// Dispatch will handle action queue operations, and retries.
// Any action that implements the ScheduledAction interface may be added/removed from the queue based on StartTime.
// Any action that implements the RetryableAction interface will be rescheduled if the handler returns an error.
func (ad *ActionDispatcher) Dispatch(ctx context.Context, detailsSetter details.Observer, acker acker.Acker, actions ...fleetapi.Action) {
var err error
span, ctx := apm.StartSpan(ctx, "dispatch", "app.internal")
defer func() {
apm.CaptureError(ctx, err).Send()
span.End()
}()
ad.removeQueuedUpgrades(actions)
reportNextScheduledUpgrade(actions, detailsSetter, ad.log)
actions = ad.queueScheduledActions(actions)
actions = ad.dispatchCancelActions(ctx, actions, acker)
queued, expired := ad.gatherQueuedActions(time.Now().UTC())
ad.log.Debugf("Gathered %d actions from queue, %d actions expired", len(queued), len(expired))
ad.log.Debugf("Expired actions: %v", expired)
actions = append(actions, queued...)

However it does not take into account the actions loaded from disk when the agent starts

@AndersonQ AndersonQ added the bug Something isn't working label Dec 14, 2023
@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Dec 14, 2023
@elasticmachine
Copy link
Contributor

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

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Jun 3, 2024
@elasticmachine
Copy link
Contributor

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

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 3, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

No branches or pull requests

3 participants