Skip to content

bug(slm): fleet-wide updates target nodes whose enrollment never completed #21036

Open
0 of 4 issues completed

Description

@mrveiss

Problem

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.

Activity

  1. mrveiss commented on Nov 9, 2026

    @mrveiss
    OwnerAuthor

    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.

  2. 4 remaining items

  3. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21333, merge 19ebd20488)

  4. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21335, merge f87e78874a)

  5. mrveiss commented on Nov 12, 2026

    @mrveiss
    OwnerAuthor

    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.

    • pending / enrolling: skipped. Latest enrollment failed: skipped.
    • 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.

  6. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    Landed via the merge train (#21382, merge 6199adcab0) via #21094

  7. mrveiss commented on Nov 12, 2026

    @mrveiss
    OwnerAuthor

    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 Scheduled/run-now routes: #21391. UI display: #21095
    3. Tests: completed targeted, failed skipped, degraded-but-enrolled targeted Met (code) tests/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_degraded -
    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).

    Issue stays open: AC2 (schedule routes, #21391) and AC4 (host) remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginfrastructurephase:M1.4Wizard and SLM: choose a mode, apply it, default models workpriority: high

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions