Windows: Retry configuration profiles 3 times
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
MaxProfileRetriesis shared between Apple and Windows, split it intoMaxAppleProfileRetriesandMaxWindowsProfileRetriesso each platform can be tuned independently. SetMaxWindowsProfileRetriesto 3. (2) Verify theretriescolumn onhost_mdm_windows_profilessupports 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
- [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).
- [ ] QA: Added comment to user story confirming successful completion of test plan.
@noahtalerman for release planning assignment
hey @noahtalerman do we have an ETA on this / or even a future dated release sprint estimate yet?
FYI @marko-lisica moved this to fast draft. Up to you on if it actually needs full draft.
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.
This is ready to be worked on. I will unassign myself.
Test plan reviewed and approved for testing.
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
Retries behave as expected.
Done: Spoke with customer -pingali about this today
I couldn't think of a haiku this time. (See fleetdm.com logs for more information.)