fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Windows: Retry configuration profiles 3 times

Open getvictor opened this issue 7 months ago • 10 comments

Goal

User story
As an IT admin managing Windows hosts,
I want Windows configuration profiles to retry up to 3 times before being marked as failed
so that I can have confidence profiles will be applied reliably.

Demo: https://www.youtube.com/watch?v=Fj7lkUl8jUM Guide: https://github.com/fleetdm/fleet/pull/51920/changes Follow up story for visibility: #36990

Changes

Product

  • [ ] UI changes: Windows profiles should remain in "pending" status during retries instead of immediately showing "failed."
  • [ ] CLI (fleetctl) usage changes: No changes.
  • [ ] YAML changes: No changes.
  • [ ] REST API changes: No changes.
  • [ ] Fleet's agent (fleetd) changes: No changes.
  • [ ] Fleet server configuration changes: No changes.
  • [ ] Exposed, public API endpoint changes: No changes.
  • [ ] fleetdm.com changes: No changes.
  • [ ] GitOps mode UI changes: No changes.
  • [ ] GitOps generation changes: No changes.
  • [ ] Activity changes: No changes.
  • [ ] Permissions changes: No changes.
  • [ ] Changes to paid features or tiers: Fleet Premium and Free.
  • [ ] My device and fleetdm.com/better changes: No changes.
  • [ ] Usage statistics: No changes.
  • [ ] Other reference documentation changes: No changes.
  • [ ] First draft of test plan added
  • [ ] Once shipped, requester has been notified
  • [ ] Once shipped, dogfooding issue has been filed https://github.com/fleetdm/fleet/issues/53757

Engineering

  • [x] Test plan is finalized
  • [ ] Contributor API changes: No changes
  • [ ] Feature guide changes: No changes
  • [ ] Database schema migrations: (1) If MaxProfileRetries is shared between Apple and Windows, split it into MaxAppleProfileRetries and MaxWindowsProfileRetries so each platform can be tuned independently. Set MaxWindowsProfileRetries to 3. (2) Verify the retries column on host_mdm_windows_profiles supports values up to 3.
  • [ ] Load testing: No changes
  • [ ] Pre-QA load test: No changes
  • [ ] Load testing/osquery-perf improvements: No changes
  • [ ] This is a premium only feature: Yes

ℹ️ Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

Risk assessment

  • Risk level: Low
  • The retry change is a constant update (matching Apple's existing behavior).

Test plan

Make sure to go through the list and consider all events that might be related to this story, so we catch edge cases earlier.

Core flow -- retries

  • [x] Deploy a Windows configuration profile to a host that will fail (e.g., a malformed profile or a profile targeting an unsupported CSP)
  • [x] Verify that the profile stays in "pending" status during retries (not immediately marked "failed")
  • [x] Verify that Fleet retries the profile installation up to 3 times (1 initial attempt + 3 retries = 4 total attempts)
  • [x] Verify that the profile is marked "failed" only after all 4 attempts are exhausted
  • [x] Verify that manually resending a profile DOES not reset the retry counter (this matches Apple behavior)

UI

  • [x] Verify that the Host Details displays Windows profile failure entries with the correct information
  • [x] Verify expected UI states (loading, empty, error states if applicable)

API

  • [x] Verify error handling for invalid inputs where applicable

Permissions

  • [x] Verify role restrictions are applied correctly for global roles
  • [x] Verify role restrictions are applied correctly for fleet-level roles
  • [x] Verify the feature works correctly on Fleet Free instances

Edge cases

  • [x] Profiles stay in "Pending" longer for genuinely broken profiles. The failure paths:
    • [x] Host rejects the profile (malformed profile, unsupported CSP): one attempt is a profile-manager tick (30s) plus one device sync, so four attempts complete in a few minutes.
    • [x] Fleet-proxied SCEP returns an upstream CA error: about 5 minutes end to end for all four attempts, paced by the Windows SCEP CSP's own retry cadence rather than by Fleet.

Supplemental testing

Testing notes

  • Reference #42327 for the Apple equivalent behavior

Confirmation

  1. [x] Engineer: Added comment to user story confirming successful completion of test plan (include any special setup, test data, or configuration used during development/testing if applicable).
  2. [ ] QA: Added comment to user story confirming successful completion of test plan.

getvictor avatar Apr 03 '26 16:04 getvictor

@noahtalerman for release planning assignment

zayhanlon avatar Apr 03 '26 16:04 zayhanlon

hey @noahtalerman do we have an ETA on this / or even a future dated release sprint estimate yet?

zayhanlon avatar Apr 13 '26 15:04 zayhanlon

FYI @marko-lisica moved this to fast draft. Up to you on if it actually needs full draft.

noahtalerman avatar Apr 24 '26 21:04 noahtalerman

FYI @marko-lisica moved this to fast draft. Up to you on if it actually needs full draft.

@noahtalerman this one seems to be drafted already. Both product and engineering sections are filled, but since we won't be revisiting it during design review, we can call it a fast draft.

marko-lisica avatar Apr 27 '26 09:04 marko-lisica

This is ready to be worked on. I will unassign myself.

marko-lisica avatar Jun 02 '26 13:06 marko-lisica

Test plan reviewed and approved for testing.

thisisjoegrant avatar Jul 27 '26 18:07 thisisjoegrant

I've removed "activity" mentions from this story since it should have no changes and MDM command activity is tracked by https://github.com/fleetdm/fleet/issues/36990

cc: @melpike

getvictor avatar Aug 20 '26 16:08 getvictor

Retries behave as expected.

thisisjoegrant avatar Sep 03 '26 17:09 thisisjoegrant

Done: Spoke with customer -pingali about this today

pintomi1989 avatar Sep 25 '26 21:09 pintomi1989

I couldn't think of a haiku this time. (See fleetdm.com logs for more information.)

fleet-release avatar Sep 25 '26 21:09 fleet-release