{"record":{"id":"ae1c1eb384c7e4d2","repo":"HKUDS/DeepTutor","slug":"mineru-produced-no-output-directory","errorCode":null,"errorMessage":"MinerU produced no output directory.","messagePattern":"MinerU produced no output directory\\.","errorType":"exception","errorClass":"MinerUError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/parsing/engines/mineru/backend.py","lineNumber":169,"sourceCode":"        cli_command=cli_command,\n        extra_env=subprocess_env,\n    )\n    if not ok:\n        raise MinerUError(\n            \"Local MinerU parsing failed. Ensure MinerU is installed \"\n            \"(`pip install mineru`) or switch to cloud mode in Settings → MinerU.\"\n        )\n    working_dir = output_base / pdf_path.stem\n    if not working_dir.is_dir():\n        # Defensive: the CLI names its output dir after the PDF stem, but fall\n        # back to the newest sub-directory if that assumption ever breaks.\n        subdirs = sorted(\n            (d for d in output_base.iterdir() if d.is_dir()),\n            key=lambda d: d.stat().st_mtime,\n            reverse=True,\n        )\n        if not subdirs:\n            raise MinerUError(\"MinerU produced no output directory.\")\n        working_dir = subdirs[0]\n    return working_dir\n\n\n__all__ = [\"MinerUError\", \"local_cli_probe\", \"local_cli_version\", \"parse_pdf_to_workdir\"]\n","sourceCodeStart":151,"sourceCodeEnd":175,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/parsing/engines/mineru/backend.py#L151-L175","documentation":"After a supposedly successful MinerU CLI run, no subdirectory exists under output_base, so there is nothing to post-process. A defensive guard against CLI output-layout changes.","triggerScenarios":"The CLI's output dir naming differs (version change), output went elsewhere, or the run wrote files directly into output_base.","commonSituations":"MinerU CLI version upgrade changing output layout; output_base on a filesystem with odd mtime/dir behavior.","solutions":["Upgrade/downgrade the mineru package to a tested version.","Inspect output_base after a manual run to see actual layout; report a bug if layout changed.","Re-run the parse — transient filesystem/permission issue."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    wd = parse_pdf_to_workdir(pdf, out, cfg)\nexcept MinerUError as e:\n    if \"no output directory\" in str(e):\n        shutil.rmtree(out, ignore_errors=True); retry_once()","preventionTips":["Pin the mineru package version you validated.","Clean the output base dir between runs to avoid stale-layout confusion."],"tags":["mineru","pdf","filesystem"],"backgroundTag":"tool-output-unexpected-layout","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}