Skip to content

Agent does not show upgrade details UPG_SCHEDULED after restart #3913

Open

Description

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

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions