fleet/server
Jordan Montgomery f1662e1da6
Mark dep assignments as failed on certain server errors (#31523)
Putting this up for comments

On certain errors(like a network error, perhaps even Apple ratelimiting)
we previously would drop assignments during the DEP sync and leave the
host_dep_assignments row null and the assignment unset on the Apple
side. Because of how the sync works it is entirely possible when this
happens that we would happily go along, update the cursor and never
return to resync these devices unless and until the admin did something
that forced a resync like changing something about the cloud config
profile.

Now any devices that for any reason don't get returned by the response
get marked as failed so that our logic for retrying and processing
cooldowns picks them up for later retry.

Explanation here as far as what I think is going wrong:
https://github.com/fleetdm/fleet/issues/31385#issuecomment-3145117080

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
2025-08-06 13:15:43 -04:00
..
archtest Basic Android MDM on/off functionality (#26309) 2025-02-18 09:43:11 -06:00
authz Add ability to upload EULA via gitops (#30332) 2025-07-01 17:28:13 +01:00
aws_common Fix STS assume role in aws-sdk-go v2 (#30699) 2025-07-10 13:00:27 -03:00
bindata
config Added auth.require_http_message_signature server option. (#30983) 2025-07-17 13:23:19 +02:00
contexts Allow certain licenses to disable telemetry (#29093) 2025-05-22 14:27:07 -04:00
cron Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
datastore Fix pending unlock not going away after canceling unlock script (#31644) 2025-08-06 14:38:50 +02:00
errorstore Fixed potential panic in error handler when Redis is down. (#31643) 2025-08-06 17:14:31 +02:00
fleet Fix pending unlock not going away after canceling unlock script (#31644) 2025-08-06 14:38:50 +02:00
goose Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
health 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
launcher Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
live_query Fix flakey livequery test (#21666) 2024-08-29 10:03:45 -06:00
logging Fix STS assume role in aws-sdk-go v2 (#30699) 2025-07-10 13:00:27 -03:00
mail Fix STS assume role in aws-sdk-go v2 (#30699) 2025-07-10 13:00:27 -03:00
mdm Mark dep assignments as failed on certain server errors (#31523) 2025-08-06 13:15:43 -04:00
mock Implement BitLocker "action required" status (#31451) 2025-08-05 11:23:27 -05:00
policies Allow users of Fleet in Primo mode to access Software automations and Failing policy ticket & webhook automations (#30865) 2025-07-17 15:53:31 -07:00
ptr Added better handling of timeout and insufficient permissions errors in NDES SCEP proxy. (#23654) 2024-11-11 14:57:28 -06:00
pubsub Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
service Mark dep assignments as failed on certain server errors (#31523) 2025-08-06 13:15:43 -04:00
shellquote Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
sso Make sure SAML requests always ask for email format NameID (#31008) 2025-07-17 14:25:33 -04:00
test Updated SQL modes in tests to match production. (#31445) 2025-08-03 08:18:13 +02:00
version Move external dependency fleetdm/kolide-kit to monorepo (#15861) 2024-01-02 18:22:52 -03:00
vulnerabilities Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
webhooks Allow users of Fleet in Primo mode to access Software automations and Failing policy ticket & webhook automations (#30865) 2025-07-17 15:53:31 -07:00
websocket
worker Updated SQL modes in tests to match production. (#31445) 2025-08-03 08:18:13 +02:00
utils.go Fix CleanupExpiredHosts to prevent deletion of DEP-assigned hosts (#28313) 2025-04-18 12:49:03 -05:00
utils_test.go feature: target profiles by labels (#16202) 2024-01-26 11:00:58 -05:00