docling-project/docling · error · SystemExit
Input file does not exist: {args.input_file}
Error message
Input file does not exist: {args.input_file} What it means
SystemExit raised by main() in perfs/plot_memory_metrics.py when the --input file does not exist or is not a regular file (Path.is_file() check). It is the first validation in main(), guarding before matplotlib is imported and before metrics files are resolved.
Source
Thrown at perfs/plot_memory_metrics.py:115
payload = json.loads(line)
event = payload.get("event")
total_page_no = payload.get("total_page_no")
if not isinstance(total_page_no, int):
continue
if event == "loaded":
memory_loaded = payload.get("memory_loaded_mb")
if isinstance(memory_loaded, dict):
total_pages.append(total_page_no)
_append_memory_values(loaded_metrics, memory_loaded)
return total_pages, loaded_metrics
def main() -> None:
args = parse_args()
if not args.input_file.is_file():
raise SystemExit(f"Input file does not exist: {args.input_file}")
try:
import matplotlib.pyplot as plt
except ImportError as exc:
raise SystemExit(
"Plotting requires matplotlib. Install it in the environment first."
) from exc
loaded_runs = []
for label, metrics_file in _resolve_metrics_files(args.input_file):
if not metrics_file.is_file():
raise SystemExit(f"Metrics file does not exist: {metrics_file}")
total_pages, loaded_metrics = load_points(metrics_file)
if total_pages:
loaded_runs.append((label, total_pages, loaded_metrics))
if not loaded_runs:
raise SystemExit(f"No plotable data found in {args.input_file}")View on GitHub (pinned to 61d76f1ff3)
Solutions
- Verify the path with 'ls -l <file>' and correct typos.
- Use absolute paths or run from the directory containing the report.
- If the artifact lives in CI, ensure the report/metrics files are uploaded and downloaded into the plotting job before invoking the plotter.
Example fix
# before $ python perfs/plot_memory_metrics.py summary.jso # typo # after $ python perfs/plot_memory_metrics.py /abs/path/to/summary.json
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
p = Path(args.input_file).expanduser()
if not p.is_file():
raise SystemExit(f"input report not found: {p}") Prevention
- Use absolute paths or verify with ls before invoking the plotter.
- In CI, download report artifacts before the plotting step and assert they exist.
- Double-check argument order (--input is the report/jsonl, not the output plot).
When it happens
Trigger: Running plot_memory_metrics.py with a mistyped path, a relative path from the wrong cwd, or pointing at a directory instead of the report/JSONL file.
Common situations: Shell completion or copy-paste inserting a wrong filename; artifacts not yet copied out of a CI job before plotting; passing the output-plot path as input by argument-order confusion.
Related errors
- Input directory does not exist: {input_dir}
- Metrics file does not exist: {metrics_file}
- Hugging Face dataset support requires 'huggingface_hub' to b
- Dataset '{args.repo_id}' does not contain a 'pdf/' subfolder
- {input_file} is not valid JSONL or a JSON summary report.
AI-assisted analysis of docling-project/docling@61d76f1ff3 (2026-08-14).
Data as JSON: /api/errors/541944b650529671.
Report an issue: GitHub.