{"record":{"id":"541944b650529671","repo":"docling-project/docling","slug":"input-file-does-not-exist-args-input-file","errorCode":null,"errorMessage":"Input file does not exist: {args.input_file}","messagePattern":"Input file does not exist: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"perfs/plot_memory_metrics.py","lineNumber":115,"sourceCode":"            payload = json.loads(line)\n            event = payload.get(\"event\")\n            total_page_no = payload.get(\"total_page_no\")\n            if not isinstance(total_page_no, int):\n                continue\n\n            if event == \"loaded\":\n                memory_loaded = payload.get(\"memory_loaded_mb\")\n                if isinstance(memory_loaded, dict):\n                    total_pages.append(total_page_no)\n                    _append_memory_values(loaded_metrics, memory_loaded)\n\n    return total_pages, loaded_metrics\n\n\ndef main() -> None:\n    args = parse_args()\n    if not args.input_file.is_file():\n        raise SystemExit(f\"Input file does not exist: {args.input_file}\")\n\n    try:\n        import matplotlib.pyplot as plt\n    except ImportError as exc:\n        raise SystemExit(\n            \"Plotting requires matplotlib. Install it in the environment first.\"\n        ) from exc\n\n    loaded_runs = []\n    for label, metrics_file in _resolve_metrics_files(args.input_file):\n        if not metrics_file.is_file():\n            raise SystemExit(f\"Metrics file does not exist: {metrics_file}\")\n        total_pages, loaded_metrics = load_points(metrics_file)\n        if total_pages:\n            loaded_runs.append((label, total_pages, loaded_metrics))\n\n    if not loaded_runs:\n        raise SystemExit(f\"No plotable data found in {args.input_file}\")","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/perfs/plot_memory_metrics.py#L97-L133","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\n$ python perfs/plot_memory_metrics.py summary.jso   # typo\n\n# after\n$ python perfs/plot_memory_metrics.py /abs/path/to/summary.json","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\np = Path(args.input_file).expanduser()\nif not p.is_file():\n    raise SystemExit(f\"input report not found: {p}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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)."],"tags":["perf-tooling","filesystem","cli","path"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}