fix(ansible): surface run failure reason; widget audit cleanup
CI / lint (push) Successful in 2s
CI / unit (push) Successful in 7s
CI / integration (push) Successful in 2m17s
CI / publish (push) Successful in 1m1s

Run UX: when start_run throws before/around launch (e.g. ENOSPC creating the
temp dir — the box is out of disk), the run was marked "failed" with empty
output. Now the exception is broadcast + written to the run output/results so
the run view shows e.g. "[run error] OSError: [Errno 28] No space left on
device" instead of a blank failure.

Widget audit follow-ups (no broken links were found; these are consistency):
- host_resource_history widget now charts root (/) disk, consistent with the
  host panel (was the opaque "disk worst").
- host_resources widget: tooltip on the health dot explaining it warns on the
  worst mount while the number shows root.
- status_overview widget detail_url /status → /status/ (avoid redirect).
- Normalize ad-hoc widget empty-states to the shared .empty style (wording,
  which distinguishes "configured" vs "data yet", preserved).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 12:46:08 -04:00
parent 609bd78af2
commit e0253fba48
8 changed files with 27 additions and 14 deletions
+8 -1
View File
@@ -462,9 +462,16 @@ async def start_run(
except _Aborted:
final_status = "cancelled"
except Exception:
except Exception as exc:
logger.exception("Ansible run %s failed with exception", run_id)
final_status = "cancelled" if run_id in _cancelled else "failed"
# Surface WHY in the run output instead of an empty "failed" (e.g. ENOSPC
# when the temp dir can't be created — the run never reaches Ansible).
msg = f"[run error] {type(exc).__name__}: {exc}"
_broadcast(run_id, msg)
if len(failures) < _FAILURE_CAP:
failures.append(msg[:500])
db_output = (db_output + "\n" + msg) if db_output else msg
finally:
if logf is not None:
logf.close()
+1 -1
View File
@@ -27,7 +27,7 @@ WIDGET_REGISTRY: dict[str, dict] = {
"label": "Status — Overview",
"description": "Unified up/down/pending summary across ping, DNS, and HTTP monitors",
"hx_url": "/status/widget",
"detail_url": "/status",
"detail_url": "/status/",
"plugin": None,
"poll": True,
"params": [],
+1 -1
View File
@@ -7,7 +7,7 @@
{% set problems = entries | rejectattr("status", "equalto", "up") | list %}
{% if not entries %}
<div style="color:var(--text-muted);font-size:0.85rem;padding:0.3rem 0;">No monitors configured.</div>
<p class="empty" style="padding:0.3rem 0;font-size:0.85rem;">No monitors configured.</p>
{% elif not problems %}
<div style="color:var(--green);font-size:0.85rem;padding:0.3rem 0;">✓ All {{ up }} monitors are up.</div>
{% else %}