{"record":{"id":"7aff5a5394e0e995","repo":"github/spec-kit","slug":"invalid-yaml-in-path-e","errorCode":null,"errorMessage":"Invalid YAML in {path}: {e}","messagePattern":"Invalid YAML in (.+?): (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/extensions/__init__.py","lineNumber":247,"sourceCode":"\n        Args:\n            manifest_path: Path to extension.yml file\n\n        Raises:\n            ValidationError: If manifest is invalid\n        \"\"\"\n        self.path = manifest_path\n        self.warnings: List[str] = []\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 ValidationError(f\"Invalid YAML in {path}: {e}\")\n        except FileNotFoundError:\n            raise ValidationError(f\"Manifest not found: {path}\")\n        except UnicodeDecodeError as e:\n            raise ValidationError(\n                f\"Manifest is not valid UTF-8: {path} ({e.reason} at byte {e.start})\"\n            )\n        except OSError as e:\n            raise ValidationError(f\"Could not read manifest {path}: {e}\")\n        if not isinstance(data, dict):\n            raise ValidationError(\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":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/extensions/__init__.py#L229-L265","documentation":"Raised while loading an extension manifest: yaml.safe_load threw a YAMLError, meaning the file exists and is readable but is not well-formed YAML. The underlying parser error (line/column, problem description) is embedded in the message.","triggerScenarios":"ExtensionManifest(manifest_path) opens the manifest and yaml.safe_load raises — syntax errors like tabs used for indentation, unbalanced brackets, a key with an unclosed quote, or duplicate anchors/recursion.","commonSituations":"Hand-editing extension.yaml and breaking indentation; pasting config from a browser introducing smart quotes or tabs; a merge conflict left in the file; template placeholders like ${VAR} colliding with YAML flow syntax.","solutions":["Read the appended parser detail (it names the line and problem) and fix that spot in the manifest.","Run `python -c \"import yaml,sys; yaml.safe_load(open(sys.argv[1]))\" extension.yaml` to reproduce locally.","Replace tabs with spaces and re-check indentation consistency.","If a merge conflict remains, resolve it and remove the conflict markers."],"exampleFix":"# before (tab before command)\nevents:\n\tpre_tool_use:\n\t\tcommand: \"./h.sh\"\n\n# after (spaces)\nevents:\n  pre_tool_use:\n    command: \"./h.sh\"","handlingStrategy":"validation","validationCode":"import yaml\ntry:\n    yaml.safe_load(open(manifest_path, encoding=\"utf-8\"))\nexcept yaml.YAMLError:\n    raise SystemExit(f\"fix YAML syntax in {manifest_path} first\")","typeGuard":null,"tryCatchPattern":"from specify_cli.extensions import ValidationError\ntry:\n    manifest = ExtensionManifest(path)\nexcept ValidationError as e:\n    if str(e).startswith(\"Invalid YAML\"):\n        run_yaml_linter(path); fix_and_retry()","preventionTips":["Configure editors to use spaces (never tabs) for YAML.","Add a CI step that safe_loads every extension.yaml before install."],"tags":["yaml","manifest","extensions","parsing"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}