Dashboard errors
Common error signatures
Dashboard errors fall into three categories, one per pipeline stage:
- Refresh errors —
build_snapshot()fails to locate or parsequeries.yaml. When the file is missing,build_snapshot()returns a partial snapshot dict that contains an"error"key rather than raising an exception. Downstream code that treats the snapshot as complete will encounter unexpectedNonevalues or missing keys. - Render errors —
render()cannot write the output file, or the HTML template is missing the sentinel strings__ATTUNE_SNAPSHOT__or__ATTUNE_TITLE__. A missing sentinel means the JSON snapshot is never embedded and the output HTML is silently incomplete. - Display errors —
display()receives a malformed or partial snapshot (for example, one produced by a failed refresh) and raises aKeyErrororTypeErrorwhen Rich tries to format a missing field.
Where errors originate
| Stage | Function | File |
|---|---|---|
| Refresh | build_snapshot(corpus_package, queries_path) |
src/attune_rag/dashboard/refresh.py |
| Refresh | main(corpus_package) |
src/attune_rag/dashboard/refresh.py |
| Render | render(out, snapshot, title) |
src/attune_rag/dashboard/render.py |
| Display | display(snapshot, console) |
src/attune_rag/dashboard/show.py |
| Display | main(corpus_package) |
src/attune_rag/dashboard/show.py |
How to diagnose
-
Check whether the snapshot contains an error key. A partial snapshot from
build_snapshot()includes an"error"field whenqueries.yamlis missing or unreadable. Print or log the snapshot dict immediately after callingbuild_snapshot()and look for that key before passing the snapshot torender()ordisplay(). -
Verify the output path is writable.
render()writes an HTML file to theoutpath you supply. If the parent directory does not exist or is in a protected location (the module explicitly guards against/etc,/sys,/proc,/dev,/boot,/sbin,/bin, and/usr/bin), you will get anOSError. Confirm thatout.parentexists and that your process has write permission. -
Confirm the HTML template contains both sentinel strings.
render()replaces__ATTUNE_SNAPSHOT__with the JSON snapshot and__ATTUNE_TITLE__with the dashboard title. If a custom template is missing either string, the substitution silently produces broken HTML. Search the template file for both literals before runningrender(). -
Trace
KeyErrororTypeErrorindisplay()back to the snapshot. If Rich raises during terminal rendering, the snapshot passed todisplay()is almost always the culprit — either it is partial (refresh failed) or a key was renamed. Compare the snapshot dict's keys against the fieldsdisplay()accesses and fix the upstream source of the snapshot.
Source files
src/attune_rag/dashboard/__init__.pysrc/attune_rag/dashboard/refresh.pysrc/attune_rag/dashboard/render.pysrc/attune_rag/dashboard/show.py
Tags: dashboard, living-docs, html, terminal, snapshot, freshness