{"record":{"id":"22fa7318dda999e1","repo":"unslothai/unsloth","slug":"seed-file-does-not-exist-expanded","errorCode":null,"errorMessage":"Seed file does not exist: {expanded}","messagePattern":"Seed file does not exist: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/plugins/data-designer-unstructured-seed/src/data_designer_unstructured_seed/config.py","lineNumber":37,"sourceCode":"\n    @model_validator(mode = \"before\")\n    @classmethod\n    def _normalize_legacy_path(cls, data):\n        if isinstance(data, dict) and \"paths\" not in data and data.get(\"path\"):\n            data = dict(data)\n            data[\"paths\"] = [data[\"path\"]]\n        return data\n\n    chunk_size: int = DEFAULT_CHUNK_SIZE\n    chunk_overlap: int = DEFAULT_CHUNK_OVERLAP\n\n    @field_validator(\"paths\")\n    @classmethod\n    def _validate_paths(cls, v: list[str]) -> list[str]:\n        for p in v:\n            expanded = Path(p).expanduser()\n            if not expanded.is_file():\n                raise ValueError(f\"Seed file does not exist: {expanded}\")\n        return v\n\n    @field_validator(\"chunk_size\")\n    @classmethod\n    def _resolve_chunk_size(cls, v: int) -> int:\n        cs, _ = resolve_chunking(v, 0)\n        return cs\n\n    @field_validator(\"chunk_overlap\")\n    @classmethod\n    def _resolve_chunk_overlap(cls, v: int, info) -> int:\n        cs = info.data.get(\"chunk_size\", DEFAULT_CHUNK_SIZE)\n        _, co = resolve_chunking(cs, v)\n        return co\n","sourceCodeStart":19,"sourceCodeEnd":52,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/plugins/data-designer-unstructured-seed/src/data_designer_unstructured_seed/config.py#L19-L52","documentation":"A pydantic field validator on the `paths` field of the data-designer-unstructured-seed plugin config rejects configuration whose seed file path does not resolve to an existing regular file after `Path.expanduser()`. It is raised as a ValueError inside `@field_validator(\"paths\")`, so pydantic surfaces it as a ValidationError when the plugin config is instantiated. The check runs at config-load time to fail fast before any ingestion starts.","triggerScenarios":"Instantiating the seed config (directly or via plugin load) with `path`/`paths` entries that (a) point to a nonexistent file, (b) point to a directory, or (c) use a `~user` or env-style string that expanduser() does not resolve to the intended location. Also triggered by relative paths evaluated against an unexpected working directory.","commonSituations":"Typos or stale paths in a seed config file; running the backend from a different cwd so relative seed paths break; paths copied from another machine/user where the home directory differs; the seed file not yet downloaded/generated when the pipeline starts.","solutions":["Check the path exists before building the config: `Path(p).expanduser().is_file()`","Use an absolute path for seed files, or resolve relative paths against an explicit base directory before passing them in","If the file should have been produced by an earlier pipeline stage, verify that stage ran and wrote the expected output before loading this config","Confirm you are not accidentally passing a directory or a glob pattern; the validator requires one concrete file per entry"],"exampleFix":"// before\nconfig = SeedConfig(path=\"~/data/seeds\")  # directory, or missing file\n// after\nfrom pathlib import Path\np = Path(\"~/data/seeds.jsonl\").expanduser().resolve()\nif not p.is_file():\n    raise FileNotFoundError(f\"seed file missing: {p}\")\nconfig = SeedConfig(path=str(p))","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef valid_seed_paths(paths: list[str]) -> bool:\n    return all(Path(p).expanduser().is_file() for p in paths)","typeGuard":null,"tryCatchPattern":"from pydantic import ValidationError\n\ntry:\n    cfg = SeedConfig(paths=[p])\nexcept ValidationError as e:\n    if \"Seed file does not exist\" in str(e):\n        raise FileNotFoundError(f\"missing seed file: {p}\") from e\n    raise","preventionTips":["Resolve seed paths to absolute form at config-build time","Assert file existence right after download/generation stages produce them","Never pass directories or glob patterns where a single file path is required"],"tags":["pydantic","config-validation","filesystem","data-designer"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}