{"record":{"id":"6c0252fac43e8536","repo":"github/spec-kit","slug":"manifest-not-found-path-6c0252","errorCode":null,"errorMessage":"Manifest not found: {path}","messagePattern":"Manifest not found: (.+?)","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":290,"sourceCode":"        Args:\n            manifest_path: Path to preset.yml file\n\n        Raises:\n            PresetValidationError: If manifest is invalid\n        \"\"\"\n        self.path = manifest_path\n        self.data = self._load_yaml(manifest_path)\n        self._validate()\n\n    def _load_yaml(self, path: Path) -> dict:\n        \"\"\"Load YAML file safely.\"\"\"\n        try:\n            with open(path, 'r', encoding='utf-8') as f:\n                data = yaml.safe_load(f)\n        except yaml.YAMLError as e:\n            raise PresetValidationError(f\"Invalid YAML in {path}: {e}\")\n        except FileNotFoundError:\n            raise PresetValidationError(f\"Manifest not found: {path}\")\n        except UnicodeDecodeError as e:\n            raise PresetValidationError(\n                f\"Manifest is not valid UTF-8: {path} ({e.reason} at byte {e.start})\"\n            )\n        except OSError as e:\n            raise PresetValidationError(f\"Could not read manifest {path}: {e}\")\n        if data is None:\n            return {}\n        if not isinstance(data, dict):\n            raise PresetValidationError(\n                f\"Manifest must be a YAML mapping, got {type(data).__name__}: {path}\"\n            )\n        return data\n\n    def _validate(self):\n        \"\"\"Validate manifest structure and required fields.\"\"\"\n        # Check required top-level fields\n        for field in self.REQUIRED_FIELDS:","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L272-L308","documentation":"PresetValidationError raised when opening the preset manifest file raises FileNotFoundError — the YAML path passed to PresetManifest does not exist on disk. It is converted to a validation error so callers get one exception type for all bad-manifest conditions.","triggerScenarios":"Constructing PresetManifest(Path('presets/mine.yaml')) (or the preset CLI with --preset pointing at a missing file) — typo in the name, wrong working directory, or the preset not cloned/installed yet.","commonSituations":"Running from a different cwd so a relative preset path misses; referencing a preset from a repo not yet fetched; case-sensitivity mismatches between macOS and Linux; a missing file after a clean clone.","solutions":["Verify the path exists: ls the exact path from the error message","Use an absolute path or resolve it against a known base dir before passing it in","If using a built-in/remote preset name, make sure it is downloaded to the expected location first"],"exampleFix":"# before\nmanifest = PresetManifest(Path(\"preset.yaml\"))  # cwd is elsewhere\n# after\nbase = Path(__file__).parent\nmanifest = PresetManifest(base / \"presets\" / \"preset.yaml\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\npath = Path(preset_path)\nif not path.is_file():\n    raise SystemExit(f\"preset manifest not found: {path}\")\nmanifest = PresetManifest(path)","typeGuard":"def preset_manifest_exists(path: str | Path) -> bool:\n    p = Path(path)\n    return p.is_file() and p.suffix in {\".yaml\", \".yml\"}","tryCatchPattern":"from specify_cli.presets import PresetValidationError\ntry:\n    manifest = PresetManifest(path)\nexcept PresetValidationError as exc:\n    if \"Manifest not found\" in str(exc):\n        locate_preset_or_prompt_user(path)\n    raise","preventionTips":["Resolve preset paths against a known base directory, not cwd","Verify preset downloads/clones succeeded before referencing them","Watch case sensitivity when sharing paths between macOS and Linux"],"tags":["presets","file-not-found","yaml"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}