Host transferred to a team via the POST /api/v1/fleet/hosts/transfer endpoint remained in No Team #26879
Labels
bug
Something isn't working as documented
customer-deebradel
#g-orchestration
Orchestration product group
:incoming
New issue in triage process.
:reproduce
Involves documenting reproduction steps in the issue
Fleet version: 4.63.1
Slack thread where this was reported: https://fleetdm.slack.com/archives/C075TURNLB0/p1741027763838929
Engineering Slack thread: https://fleetdm.slack.com/archives/C019WG4GH0A/p1741099768784259
💥 Actual behavior
customer-deebradel
has an automation that detects when a macOS host becomes MDM enrolled and transfers it to a desired team in Fleet.They are reporting an issue with this flow, where they used the API to transfer a host to a team, but the host did not transfer to the team. The API responded with a
200
, the Flet server logs show the API call with seemingly no associated errors, and the global actives feed shows the host was transferred to the team. Yet, the host remained in No Team.I have no reproduced this on my own yet and
deebradel
has seen it happen once so far.🧑💻 Steps to reproduce
mdm_enrolled
event to the global activity webhook and enroll the host into your Fleet server.mdm_enrolled
webhook event should kick off your automation to transfer the host to another team.🕯️ More info (optional)
deebradel
is doing:mdm_enrolled
audit event, capture thehost_serial
from the webhook payload.host_serial
to make a call to the Get host by identifier endpoint (GET /api/v1/fleet/hosts/identifier/:identifier
), using the serial number as the identifier. Capture theid
from that response.id
from the previous step to transfer the host to a new team by making a call to the Transfer hosts to a team endpoint (POST /api/v1/fleet/hosts/transfer
).Some other thoughts:
I am wondering if there is a potential race condition happening related to the timing of delivering MDM profiles, installing the fleet-base.pkg via InstallEnterpriseApplication command, and transferring the host via the API.
Fleetd configuration
profile to the host that contains the enrollment secret for No Team.mdm_enrolled
webhook.Fleetd configuration
profile is still on the host.fleet_enrolled
when the agent installs and goes back to No Teams based on the information in theFleetd configuration profile
(which had not yet been updated on the host with the new team's information when the agent installed).The text was updated successfully, but these errors were encountered: