fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3.02k stars 419 forks source link

Assigning automatic enrollment (DEP) profile sometimes fails #14957

Closed roperzh closed 9 months ago

roperzh commented 11 months ago

Fleet version: 4.39.0

💥  Actual behavior

When a macOS host is assigned a automatic enrollment (DEP) profile using Apple's AssignProfile API, the Apple server sometimes return a 200 response w/ an error in response body:

{
  "profile_uuid": "9145EDB932A42C48A9DD56AD69213C64",
  "devices": [{"REDACTED_SERIAL_NUMBER": "FAILED"}]
}

Fleet is currently ignoring the response body, and we need to understand:

  1. What to do when we get that error
  2. How to prevent that error state

🧑‍💻  Steps to reproduce

Unclear what are the steps, but this is what I (Roberto) did:

  1. Add a DEP profile to "No team"
  2. Create a team and add a DEP profile to that team
  3. Move a macOS host from "No team" to the team with the custom DEP profile

🕯️ More info

The below fix is what we've heard has worked in the past from a reputable developer whose built open-source MDM solutions:

I would suggest you put the serials that returned FAILED on a 24 hour cooldown and retry in 24 hours. Usually that resets any server side rate limits you might have run into.

🛠️ To fix

Now:

Later:

UPDATE: As of now, no devices are failing DEP profile assignment. Customer used the wait 24 hours workaround for devices in prod. Seems like we (Fleet) need to repro ourselves. Plan is to close the bug and prioritize this story as a next step: https://github.com/fleetdm/fleet/issues/15461

noahtalerman commented 11 months ago

@georgekarrv heads up this bug is coming back to product drafting to design some solution.

cc @zayhanlon

JoStableford commented 10 months ago

Related to a Slack conversation

lukeheath commented 9 months ago

@georgekarrv Moving to awaiting QA.

sabrinabuckets commented 9 months ago

Able to observe significantly improved profile assignment times in my local instance vs Dogfood.

fleet-release commented 9 months ago

Failed profile assign, A pause, then try again, Fleet's wisdom refines.