{"record":{"id":"2d31603ea72eff84","repo":"OpenBMB/VoxCPM","slug":"file-type-file-path-does-not-exist","errorCode":null,"errorMessage":"{file_type} '{file_path}' does not exist","messagePattern":"(.+?) '(.+?)' does not exist","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/voxcpm/cli.py","lineNumber":26,"sourceCode":"import argparse\nimport json\nimport os\nimport sys\nfrom pathlib import Path\n\nfrom voxcpm.timestamps import align_audio_file\n\nDEFAULT_HF_MODEL_ID = \"openbmb/VoxCPM2\"\n\n# -----------------------------\n# Validators\n# -----------------------------\n\n\ndef validate_file_exists(file_path: str, file_type: str = \"file\") -> Path:\n    path = Path(file_path)\n    if not path.exists():\n        raise FileNotFoundError(f\"{file_type} '{file_path}' does not exist\")\n    return path\n\n\ndef require_file_exists(file_path: str, parser, file_type: str = \"file\") -> Path:\n    try:\n        return validate_file_exists(file_path, file_type)\n    except FileNotFoundError as exc:\n        parser.error(str(exc))\n\n\ndef validate_output_path(output_path: str) -> Path:\n    path = Path(output_path)\n    path.parent.mkdir(parents=True, exist_ok=True)\n    return path\n\n\ndef validate_ranges(args, parser):\n    \"\"\"Validate numeric argument ranges.\"\"\"","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/OpenBMB/VoxCPM/blob/f5a1c6a6b901bc732e20f0d59a369f6829ad717a/src/voxcpm/cli.py#L8-L44","documentation":"Raised by validate_file_exists in voxcpm.cli when the given path does not exist on disk before the CLI proceeds. It is a guard clause so downstream code can assume a valid Path. The message prefixes the file_type (e.g. 'input file', 'prompt wav') for context.","triggerScenarios":"Calling voxcpm CLI subcommands that validate inputs via require_file_exists (e.g. batch input file, prompt audio path) with a misspelled, relative-path-resolved-wrong, or missing file.","commonSituations":"Typos in paths, running the CLI from a different working directory so relative paths break, or files not yet downloaded/created by a previous pipeline step.","solutions":["Verify the path exists and correct typos/absolute vs relative path","Run the CLI from the directory containing the file or use an absolute path","If generated by an upstream step, ensure that step succeeded first"],"exampleFix":"# before\nvoxcpm batch --input ./data/missing.txt\n# after\nvoxcpm batch --input /abs/path/data/inputs.txt","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(file_path)\nif not p.exists():\n    raise SystemExit(f\"{file_type} '{p}' does not exist\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths built from a known root","Validate inputs in your wrapper script before invoking the CLI"],"tags":["cli","file-not-found","path-validation"],"backgroundTag":"file-not-found","analyzedSha":"f5a1c6a6b901bc732e20f0d59a369f6829ad717a","analyzedAt":"2026-08-27T05:54:30.617Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}