docling-project/docling · error · SystemExit

No metrics files found in summary report: {input_file}

Error message

No metrics files found in summary report: {input_file}

What it means

SystemExit raised by _resolve_metrics_files() in perfs/plot_memory_metrics.py when the summary report's 'runs' list yields zero usable metrics entries. Entries are only kept when they are dicts containing a string 'metrics_file' value; if all runs are malformed or lack that key, the resolved list is empty and plotting cannot proceed.

Source

Thrown at perfs/plot_memory_metrics.py:69

    for index, run in enumerate(runs, start=1):
        if not isinstance(run, dict):
            continue
        metrics_file = run.get("metrics_file")
        if not isinstance(metrics_file, str):
            continue
        thread_count = run.get("threads")
        label = (
            f"threads={thread_count}"
            if isinstance(thread_count, int)
            else f"run {index}"
        )
        metrics_path = Path(metrics_file)
        if not metrics_path.is_absolute():
            metrics_path = input_file.parent / metrics_path
        metrics_files.append((label, metrics_path))

    if not metrics_files:
        raise SystemExit(f"No metrics files found in summary report: {input_file}")
    return metrics_files


def _empty_series() -> dict[str, list[float]]:
    return {key: [] for key in MEMORY_KEYS}


def _append_memory_values(
    target: dict[str, list[float]],
    memory_payload: dict[str, Any] | None,
) -> None:
    for key in MEMORY_KEYS:
        value = None if memory_payload is None else memory_payload.get(key)
        if isinstance(value, int | float):
            target[key].append(float(value))
        else:
            target[key].append(float("nan"))

View on GitHub (pinned to 61d76f1ff3)

Solutions

  1. Re-run the benchmark for at least one configuration that completes successfully so 'runs' contains a dict with a valid 'metrics_file' string.
  2. Inspect the runs array ('python -c "import json;print(json.load(open('s.json'))['runs'])"') and fix/rename keys if the schema drifted.
  3. If metrics files were moved, update each run's 'metrics_file' path (relative paths are resolved against the summary's directory).

Example fix

# before: runs entries look like {"threads": 8, "error": "crash"}
$ python perfs/plot_memory_metrics.py summary.json
# SystemExit: No metrics files found in summary report: summary.json

# after: ensure at least one successful run, e.g.
$ python perfs/iterate_pdf_pages.py --input-dir ./pdfs --threads 8 --metrics-file metrics.jsonl --report-file summary.json
$ python perfs/plot_memory_metrics.py summary.json
Defensive patterns

Strategy: validation

Validate before calling

import json

data = json.loads(Path(summary).read_text(encoding="utf-8"))
usable = [r for r in data.get("runs", []) if isinstance(r, dict) and isinstance(r.get("metrics_file"), str)]
if not usable:
    raise SystemExit("summary has no runs with metrics_file; rerun benchmark")

Type guard

def has_usable_runs(data: object) -> bool:
    return isinstance(data, dict) and any(
        isinstance(r, dict) and isinstance(r.get("metrics_file"), str)
        for r in data.get("runs", [])
    )

Prevention

When it happens

Trigger: A summary whose runs entries omit 'metrics_file' (e.g. runs that failed before metrics were written), or entries that are strings/nulls instead of objects; also a 'runs' array that is empty.

Common situations: Benchmark summaries from partially failed runs where crashing thread-count configurations never produced metrics; older report writers that stored the path under a different key; summaries edited to strip absolute paths for sharing.

Related errors


AI-assisted analysis of docling-project/docling@61d76f1ff3 (2026-08-14). Data as JSON: /api/errors/2b7b483a7e3aed86. Report an issue: GitHub.