{"record":{"id":"918a4c6aef7004e3","repo":"opendatalab/MinerU","slug":"no-supported-files-found-in-directory-path","errorCode":null,"errorMessage":"No supported files found in directory: {path}","messagePattern":"No supported files found in directory: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"demo/demo.py","lineNumber":40,"sourceCode":"        file_suffix = guess_suffix_by_path(path)\n        if file_suffix not in SUPPORTED_INPUT_SUFFIXES:\n            raise ValueError(f\"Unsupported input file type: {path.name}\")\n        return [path]\n\n    if not path.is_dir():\n        raise ValueError(f\"Input path must be a file or directory: {path}\")\n\n    input_files = sorted(\n        (\n            candidate.resolve()\n            for candidate in path.iterdir()\n            if candidate.is_file()\n            and guess_suffix_by_path(candidate) in SUPPORTED_INPUT_SUFFIXES\n        ),\n        key=lambda item: item.name,\n    )\n    if not input_files:\n        raise ValueError(f\"No supported files found in directory: {path}\")\n    return input_files\n\n\ndef build_form_data(\n    language: str,\n    backend: str,\n    parse_method: str,\n    formula_enable: bool,\n    table_enable: bool,\n    server_url: str | None,\n    start_page_id: int,\n    end_page_id: int | None,\n    image_analysis: bool = True,\n    effort: str = \"medium\",\n) -> dict[str, str | list[str]]:\n    return _api_client.build_parse_request_form_data(\n        lang_list=[language],\n        backend=backend,","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/demo/demo.py#L22-L58","documentation":"Raised by collect_input_files() when input_path is a valid directory but contains zero regular files whose suffix is in SUPPORTED_INPUT_SUFFIXES. Directories are scanned with iterdir(), filtered to supported files, and the resulting list must be non-empty.","triggerScenarios":"Passing an empty directory, or one containing only unsupported types (.txt, .md), subdirectories, or hidden/unsupported files.","commonSituations":"Wrong directory passed (e.g. parent of the data folder); conversion step wrote outputs elsewhere; directory contains only intermediate artifacts.","solutions":["List the directory contents and confirm at least one .pdf/.image/.office file is present.","Point input_path at the directory that actually holds the converted PDFs.","Convert unsupported files to PDF in place before invoking MinerU."],"exampleFix":"# before\nfiles = collect_input_files(\"./out\")  # empty dir\n\n# after\nfrom pathlib import Path\nsrc = Path(\"./converted\")\nif not any(p.suffix.lower() in {\".pdf\", \".png\", \".jpg\", \".docx\"} for p in src.iterdir()):\n    raise SystemExit(f\"no supported files in {src}\")\nfiles = collect_input_files(str(src))","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom mineru.cli.common import pdf_suffixes, image_suffixes, office_suffixes\n\nALLOWED = set(pdf_suffixes + image_suffixes + office_suffixes)\n\ndef has_supported_files(directory: str) -> bool:\n    d = Path(directory)\n    return d.is_dir() and any(\n        c.is_file() and c.suffix.lower() in ALLOWED for c in d.iterdir()\n    )","typeGuard":null,"tryCatchPattern":"try:\n    files = collect_input_files(directory)\nexcept ValueError as e:\n    if \"No supported files found\" in str(e):\n        notify_user_empty_dir(directory)\n    else:\n        raise","preventionTips":["Assert the directory is non-empty of supported files in your preflight.","Separate 'converted' output dirs from raw inputs so the right one is passed.","Surface the directory listing in logs when this fails to speed diagnosis."],"tags":["filesystem","input-validation","directory"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}