You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
8.13.0+ Fleet managed agents upgraded to the currently running version report failed upgrades indefinitely until a successful upgrade occurs. If the agent is running the latest version at the time of the duplicate upgrade attempt, it will stay in the upgrade failed state until the next version is released as there is no newer version to upgrade to.
ifstrings.HasPrefix(release.Commit(), newHash) {
u.log.Warn("Upgrade action skipped: upgrade did not occur because its the same version")
returnnil, nil
}
In v8.13.0 the agent upgrade process was refactored to account for the situation where the agent package version changed, but the agent binary version and commit hash was unchanged. When this was done an attempt to upgrade to the same version was changed to return an error. This error ultimately ends up in the upgrade details reported to fleet, but because there is no alternative upgrade path if you are upgrading to the currently running version and that version is the latest, the upgrade details persist the failed state indefinitely.
returnnil, fmt.Errorf("agent version is already %s", currentVersion)
}
There are two improvements to make here:
We make upgrades to the currently running version a no-op and implicitly successful. The upgrade process becomes idempotent in this case. Logging a warning was the correct approach in the original implementation.
We should move this check before the point in time where we download the agent package when it is possible. For official stack releases and independent agent releases, the version in the downloaded agent artifact is always unique between versions. The edge case and exception is snapshots which can have the same version (e.g. 8.16.0-SNAPSHOT) but be a different build, in which case the snapshot ID will be different once it is obtained.
The text was updated successfully, but these errors were encountered:
8.13.0+ Fleet managed agents upgraded to the currently running version report failed upgrades indefinitely until a successful upgrade occurs. If the agent is running the latest version at the time of the duplicate upgrade attempt, it will stay in the upgrade failed state until the next version is released as there is no newer version to upgrade to.
Prior to v8.13.0 we logged a warning when instructed to upgrade to the currently running version: https://github.com/elastic/elastic-agent/blob/v8.12.2/internal/pkg/agent/application/upgrade/upgrade.go#L182-L184
In v8.13.0 the agent upgrade process was refactored to account for the situation where the agent package version changed, but the agent binary version and commit hash was unchanged. When this was done an attempt to upgrade to the same version was changed to return an error. This error ultimately ends up in the upgrade details reported to fleet, but because there is no alternative upgrade path if you are upgrading to the currently running version and that version is the latest, the upgrade details persist the failed state indefinitely.
elastic-agent/internal/pkg/agent/application/upgrade/upgrade.go
Lines 215 to 218 in 56901ed
There are two improvements to make here:
The text was updated successfully, but these errors were encountered: