You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(slm): fleet-wide updates target nodes whose enrollment never completed #21036
A fleet-wide update ran its playbook against a node whose enrollment had failed before the SLM agent was installed. The SLM had kept the node's record, in a degraded and retryable state. The update wrote autobot_shared/ and constraints/ onto the node and then failed (#21035). Seen on 2026-11-07 on a test node, after its enrollment failed on #20979.
A node that never finished enrolling has no agent, no service layout and no verified role. A fleet update should not treat it as a member of the fleet.
Expected
Fleet-wide updates target only nodes whose enrollment completed. A node whose enrollment failed or never finished is skipped, the skip is logged and shown in the update's result, and the node's own retry or enroll action is the only path that provisions it.
Acceptance criteria
The inventory or target selection for fleet-wide updates excludes nodes whose enrollment is not complete (failed, pending or degraded-before-agent). Find the selection site and quote it in the PR.
A skipped node appears in the update result as "skipped: enrollment incomplete", not as a failure and not silently.
Tests cover a completed node (targeted), a failed-enrollment node (skipped) and a degraded-but-enrolled node (still targeted).
Host evidence: with a failed-enrollment node in the SLM, a fleet update completes and reports it as skipped.
Related: #21035 (the link failure this caused), #19475 (enrollment reports success when ansible ran against no hosts), #20979.
Owner decision (2026-11-09) for AC1: fleet updates skip failed + pending + degraded, i.e. every node that is not fully enrolled, not only a failed enrollment. Implemented in PR #21094; the skip reason names the state that caused it.
How degraded is treated after PR #21094 (12c8302): intent is "not fully enrolled" and AC3 says a degraded-but-enrolled node is still targeted, so status alone cannot decide.
degraded for resource_pressure or service_health: targeted (only heartbeat processing sets these, so the node has an agent).
degraded: targeted when its latest enrollment event is completed (including no_heartbeat after an agent stops); with no enrollment event (legacy), targeted when it ever heartbeated; skipped when neither exists (the degraded-before-agent case).
One predicate, unenrolled_state, serves update-all, run-now, the timed schedule, the skip reason and enrollment_skipped_nodes.
For the owner to confirm: (1) a legacy node with no enrollment event is judged enrolled by its first heartbeat; (2) scheduled and run-now runs only log their skips: surfacing them needs the shared selection function to return the skip list and a place to store it (the schedule job state has no such field and the selection is pinned by tests as a single function), so it is a follow-up, not part of this PR. AC4 host evidence is still pending.
Closure check, 2026-11-12 (Riga), against merged main. PR #21094 landed via train #21382, merge commit 6199adc (PR says Refs, so the issue stays open on purpose).
AC
Status
Evidence (autobot-slm-backend/)
What remains
1. Target selection excludes nodes whose enrollment is incomplete
Met (code)
api/code_sync.py:5162 calls split_enrollment_failed in _collect_outdated_node_ids; services/schedule_executor.py:166 calls the same helper; predicate unenrolled_state (services/node_events.py:105) skips failed-latest, pending/enrolling, and degraded without enrollment evidence
-
2. Skipped node appears in the update result as skipped, not a failure, not silent
NOT met
update-all: UpdateAllJob.enrollment_skipped_nodes (code_sync.py:4374) with reason text skipped: not fully enrolled (<state>) (models/enrollment_skip.py:23). Scheduled and run-now: the list is dropped (schedule_executor.py:166 discards it with targets, _ =), log warning only
4. Host evidence: fleet update with a failed-enrollment node reports it skipped
NOT met
No host evidence exists. A read-only host check today showed the main backend, workers and user frontend still on pre-update code; tracked in #21343
Run on a host after the update is applied
Ticked 2 of 4 (AC1, AC3). AC3 is implemented through enrollment evidence (_enrollment_evidenced, node_events.py:89: resource_pressure/service_health reasons count as enrolled; else the latest enrollment event from get_latest_enrollment_events, node_events.py:59; with none, a first last_heartbeat).
Open owner point, not decided here: a legacy node with no enrollment event counts as enrolled once it has a heartbeat (node_events.py:99).
Activity
fix(slm): review fixes for fleet enrollment skip — scheduled path, ty…
fix(slm): UpdateAllJob test fixtures carry enrollment_skipped_nodes (#…
fix(slm): real-load models.enrollment_skip under the test harness (#2…
mrveiss commentedon Nov 9, 2026
Owner decision (2026-11-09) for AC1: fleet updates skip failed + pending + degraded, i.e. every node that is not fully enrolled, not only a failed enrollment. Implemented in PR #21094; the skip reason names the state that caused it.
fix(slm): skip every node that is not fully enrolled (#21036)
fix(slm): fleet updates skip nodes whose last enrollment failed (mrve…
fix(slm): mark enrollment events structurally; regenerate SLM types (m…
fix(slm): skip only failed, pending and degraded nodes (#21036)
4 remaining items
github-actions commentedon Nov 12, 2026
Landed via the merge train (#21333, merge
19ebd20488)github-actions commentedon Nov 12, 2026
Landed via the merge train (#21335, merge
f87e78874a)revert: restore #21094 after its in-train revert in #21335 (#21036)
fix(slm): tests resolve the SLM self node and external URL instead of…
test(slm): cover the no-self-node branch and duplicate-address self n…
fix(slm): one deterministic SLM self-node lookup for update-all and s…
refactor(slm): the enrollment skip reason has its own name (#21036)
fix(slm): schedule-target fixtures build enrolled (online) nodes, not…
fix(slm): only nodes that never completed enrollment are skipped; a d…
mrveiss commentedon Nov 12, 2026
How
degradedis treated after PR #21094 (12c8302): intent is "not fully enrolled" and AC3 says a degraded-but-enrolled node is still targeted, so status alone cannot decide.pending/enrolling: skipped. Latest enrollment failed: skipped.degradedforresource_pressureorservice_health: targeted (only heartbeat processing sets these, so the node has an agent).degraded: targeted when its latest enrollment event is completed (includingno_heartbeatafter an agent stops); with no enrollment event (legacy), targeted when it ever heartbeated; skipped when neither exists (the degraded-before-agent case).unenrolled_state, serves update-all, run-now, the timed schedule, the skip reason andenrollment_skipped_nodes.For the owner to confirm: (1) a legacy node with no enrollment event is judged enrolled by its first heartbeat; (2) scheduled and run-now runs only log their skips: surfacing them needs the shared selection function to return the skip list and a place to store it (the schedule job state has no such field and the selection is pinned by tests as a single function), so it is a follow-up, not part of this PR. AC4 host evidence is still pending.
github-actions commentedon Nov 12, 2026
Landed via the merge train (#21382, merge
6199adcab0) via #21094mrveiss commentedon Nov 12, 2026
Closure check, 2026-11-12 (Riga), against merged main. PR #21094 landed via train #21382, merge commit 6199adc (PR says
Refs, so the issue stays open on purpose).autobot-slm-backend/)api/code_sync.py:5162callssplit_enrollment_failedin_collect_outdated_node_ids;services/schedule_executor.py:166calls the same helper; predicateunenrolled_state(services/node_events.py:105) skips failed-latest,pending/enrolling, anddegradedwithout enrollment evidenceUpdateAllJob.enrollment_skipped_nodes(code_sync.py:4374) with reason textskipped: not fully enrolled (<state>)(models/enrollment_skip.py:23). Scheduled and run-now: the list is dropped (schedule_executor.py:166discards it withtargets, _ =), log warning onlytests/api/test_fleet_skip_failed_enrollment_21036.py:test_a_fully_enrolled_node_is_targeted_and_skips_nothing,test_each_unenrolled_state_is_skipped_with_its_own_reason,test_a_degraded_node_that_is_enrolled_is_still_targeted,test_a_degraded_node_with_no_enrollment_evidence_is_skipped_as_degradedTicked 2 of 4 (AC1, AC3). AC3 is implemented through enrollment evidence (
_enrollment_evidenced,node_events.py:89: resource_pressure/service_health reasons count as enrolled; else the latest enrollment event fromget_latest_enrollment_events,node_events.py:59; with none, a firstlast_heartbeat).Open owner point, not decided here: a legacy node with no enrollment event counts as enrolled once it has a heartbeat (
node_events.py:99).Issue stays open: AC2 (schedule routes, #21391) and AC4 (host) remain.