{"record":{"id":"f7e9f1f46d3e2234","repo":"unslothai/unsloth","slug":"unstructured-seed-file-not-found-resolved","errorCode":null,"errorMessage":"unstructured seed file not found: {resolved}","messagePattern":"unstructured seed file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"studio/backend/plugins/data-designer-unstructured-seed/src/data_designer_unstructured_seed/chunking.py","lineNumber":110,"sourceCode":"            if len(result) >= preview_size:\n                break\n            val = next(it, None)\n            if val is not None:\n                result.append(val)\n            else:\n                exhausted.append(i)\n        for i in reversed(exhausted):\n            iterators.pop(i)\n\n    return result\n\n\ndef materialize_unstructured_seed_dataset(\n    *, source_path: Path, chunk_size: Any, chunk_overlap: Any\n) -> tuple[Path, list[dict[str, str]]]:\n    resolved = source_path.expanduser().resolve()\n    if not resolved.is_file():\n        raise FileNotFoundError(f\"unstructured seed file not found: {resolved}\")\n\n    size, overlap = resolve_chunking(chunk_size, chunk_overlap)\n    key = _compute_cache_key(\n        source_path = resolved,\n        chunk_size = size,\n        chunk_overlap = overlap,\n    )\n    parquet_path = _CACHE_DIR / f\"{key}.parquet\"\n    if parquet_path.exists():\n        return parquet_path, []\n\n    text = load_unstructured_text_file(resolved)\n    chunks = split_text_into_chunks(\n        text = text,\n        chunk_size = size,\n        chunk_overlap = overlap,\n    )\n    if not chunks:","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/plugins/data-designer-unstructured-seed/src/data_designer_unstructured_seed/chunking.py#L92-L128","documentation":"FileNotFoundError raised by materialize_unstructured_seed_dataset when the configured source_path (after expanduser().resolve()) is not an existing regular file. The check runs before chunking, cache-key computation, and parquet materialization, and the message includes the fully resolved path so relative-path or tilde-expansion mistakes are visible.","triggerScenarios":"Passing source_path pointing to a missing file, a directory, a symlink to a deleted file, or a relative path resolved against an unexpected working directory (e.g. running the service from a different cwd).","commonSituations":"Upload temp file already cleaned up when the processing job starts; container paths differing from host paths; path built by concatenating strings that drops a slash; file processed twice with cleanup in between.","solutions":["Verify the exact resolved path printed in the error exists: ls -l <resolved path>.","If relative, pass an absolute path (Path.cwd() / rel or Path(rel).resolve()) or fix the service working directory.","For uploaded files, ensure the temp file lifetime covers the async processing job, or copy to a stable staging location first."],"exampleFix":"# before\nsource_path = Path(\"data/notes.txt\")  # cwd differs at runtime\n\n# after\nsource_path = Path(\"/srv/uploads/notes.txt\")  # absolute, verified to exist","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef seed_file_ok(source_path: str | Path) -> bool:\n    p = Path(source_path).expanduser().resolve()\n    return p.is_file() and p.stat().st_size > 0","typeGuard":null,"tryCatchPattern":"from pathlib import Path\n\nresolved = Path(source_path).expanduser().resolve()\nif not resolved.is_file():\n    raise FileNotFoundError(resolved)  # fail before calling the plugin, with your own context","preventionTips":["Always pass absolute paths derived from a single config root.","Keep uploaded files alive until the async processing job completes (or copy to a staging dir)."],"tags":["file-not-found","path","plugin"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}