Skip to content

Stats poller cannot signal "unit state unknown", so the glance bar's no-data placeholder is unreachable #282

Description

@karoltheguy

Overview

The stats frame uses an empty units array for two different situations: "this server
genuinely has no container Quadlet units" and "unit state was never collected". The
frontend has a distinct no-data presentation for the second case, but the backend can
never trigger it.

Details

Use Case / Steps:

  1. Have the poller fail to collect unit state for a server (SSH scan fails, or the
    scope has no units to query).
  2. Open the Monitor tab and select that server.
  3. The glance bar shows a confident 0 / 0 / 0 rather than the no-data placeholder.

Expected vs Actual:

  • Expected: A server whose unit state could not be determined shows the placeholder
    dash, distinguishing "not measured" from "measured, and the answer is zero".
  • Actual: Both cases render 0, so an unmeasured server is indistinguishable from an
    empty one.

Details:

updateSummaryStrip (static/main.js:1772-1787) reaches its placeholder branch only
when units is undefined or null; the placeholder markup lives at
templates/dashboard.html:115-127. The backend never emits either value: when
_build_first_command (services/stats_engine.py:282-284) finds no unit names it
silently returns the plain podman ps command, unit_states_by_scope[scope] is set to
{} (:470), and the comprehension at :473-484 flattens that to a present-but-empty
list in the published payload (:486-491).

Scope:

Have the engine omit the units key (or emit null) when unit state was not collected,
while continuing to emit [] when it was collected and found nothing. This makes the
existing frontend placeholder path reachable without changing updateSummaryStrip.

Sequenced after #317, the inventory reconciler under #281. Until the quadlets table is actually populated, every server would hit the not-measured placeholder, which relabels a total outage rather than fixing it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions