{"record":{"id":"d9333adf751eccd0","repo":"docling-project/docling","slug":"input-directory-does-not-exist-input-dir","errorCode":null,"errorMessage":"Input directory does not exist: {input_dir}","messagePattern":"Input directory does not exist: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"perfs/iterate_pdf_pages.py","lineNumber":815,"sourceCode":"                    pdf_path.name,\n                    failed_pages,\n                    num_pages,\n                )\n        return processed_pages, failed_pages\n    finally:\n        doc_backend.unload()\n\n\ndef main() -> None:\n    logging.basicConfig(\n        level=logging.INFO,\n        format=\"%(message)s\",\n    )\n    args = parse_args()\n    input_dir = _resolve_input_dir(args)\n\n    if not input_dir.is_dir():\n        raise SystemExit(f\"Input directory does not exist: {input_dir}\")\n\n    if args.output_dir is not None:\n        args.output_dir.mkdir(parents=True, exist_ok=True)\n\n    report_file = args.report_file or _default_report_file(args.mode)\n\n    pdfs = sorted(input_dir.glob(args.glob))\n    if not pdfs:\n        _log.warning(\"No files matched '%s' in %s\", args.glob, input_dir)\n        return\n\n    _log.info(\"Found %d PDF file(s) in %s\", len(pdfs), input_dir)\n    _log.info(\"Running in %s mode\", args.mode)\n\n    if args.no_cache:\n        cache_file: Path | None = None\n    else:\n        cache_file = (","sourceCodeStart":797,"sourceCodeEnd":833,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/perfs/iterate_pdf_pages.py#L797-L833","documentation":"SystemExit raised by main() in perfs/iterate_pdf_pages.py when the resolved input directory does not exist on disk. After input resolution (local --input-dir or a downloaded HF snapshot), the script verifies the path with Path.is_dir() before globbing for PDFs, failing fast when the benchmark corpus location is wrong.","triggerScenarios":"Running iterate_pdf_pages.py --input-dir /nonexistent/path, or with a relative path resolved from a different working directory, or when an env-var-driven corpus path points at a mount that is not mounted.","commonSituations":"Typos or stale paths in benchmark scripts; relative paths broken by running from another cwd; network mounts/NFS shares not yet mounted in containers or CI runners; dataset snapshots deleted by cache cleanup between runs.","solutions":["Verify the path exists and is a directory: 'ls <input_dir>' before launching the benchmark.","Use absolute paths (or resolve relative to the script: Path(__file__).parent / ...) so cwd changes cannot break it.","If the corpus lives on a mount, ensure the mount is active before the run (check with 'mount | grep <path>' or re-run the mount step)."],"exampleFix":"# before\n$ python perfs/iterate_pdf_pages.py --input-dir ./pdfs   # run from wrong cwd\n\n# after\n$ python perfs/iterate_pdf_pages.py --input-dir \"$(pwd)/pdfs\"\n# or ensure the directory exists first:\n$ test -d ./pdfs || { echo 'missing corpus dir'; exit 1; }","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ninput_dir = Path(args.input_dir).expanduser().resolve()\nif not input_dir.is_dir():\n    raise SystemExit(f\"corpus directory missing: {input_dir}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve corpus paths to absolute form early in wrapper scripts.","Check mounts are present before launching containerized benchmarks.","Fail fast on missing input in your own orchestration with a clearer message than the default."],"tags":["perf-tooling","filesystem","cli","path"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}