{"record":{"id":"d668a6974a731d66","repo":"twpayne/chezmoi","slug":"s-unknown-external-type-s","errorCode":null,"errorMessage":"%s: unknown external type: %s","messagePattern":"(.+?): unknown external type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chezmoi/sourcestate.go","lineNumber":2427,"sourceCode":"\tctx context.Context,\n\texternalRelPath RelPath,\n\tparentSourceRelPath SourceRelPath,\n\texternal *External,\n\toptions *ReadOptions,\n) (map[RelPath][]SourceStateEntry, error) {\n\tswitch external.Type {\n\tcase ExternalTypeArchive:\n\t\treturn s.readExternalArchive(ctx, externalRelPath, parentSourceRelPath, external, options)\n\tcase ExternalTypeArchiveFile:\n\t\treturn s.readExternalArchiveFile(ctx, externalRelPath, parentSourceRelPath, external, options)\n\tcase ExternalTypeFile:\n\t\treturn s.readExternalFile(ctx, externalRelPath, parentSourceRelPath, external, options)\n\tcase ExternalTypeGitRepo:\n\t\treturn nil, nil\n\tcase \"\":\n\t\treturn nil, fmt.Errorf(\"%s: missing external type\", externalRelPath)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: unknown external type: %s\", externalRelPath, external.Type)\n\t}\n}\n\n// readExternalArchive reads an external archive and returns its\n// SourceStateEntries.\nfunc (s *SourceState) readExternalArchive(\n\tctx context.Context,\n\texternalRelPath RelPath,\n\tparentSourceRelPath SourceRelPath,\n\texternal *External,\n\toptions *ReadOptions,\n) (map[RelPath][]SourceStateEntry, error) {\n\tdata, urlStr, format, err := s.readExternalArchiveData(ctx, externalRelPath, external, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdirAttr := DirAttr{","sourceCodeStart":2409,"sourceCodeEnd":2445,"githubUrl":"https://github.com/twpayne/chezmoi/blob/f901167e4685db90da56d6a2a19df642cb3e0247/internal/chezmoi/sourcestate.go#L2409-L2445","documentation":"This error is reported by chezmoi's source state processing when an entry in the .chezmoiexternal data (external diff or file specification) declares an 'type' field whose value is not one of the supported external types ('archive', 'file', or 'git-repo'). The format string '%s: unknown external type: %s' prefixes the error with the external entry's key/path and includes the unsupported type value, making it clear which external definition is invalid. It typically occurs when the .chezmoiexternal.toml/yaml/json file contains a typo in the type field (e.g. 'archivee' or 'git_repo' instead of 'git-repo'), or when an external spec omits a recognized type while providing a non-empty string that chezmoi cannot interpret. To fix it, edit the external entry to use one of the documented types: 'archive' for downloaded and extracted archives, 'file' for a single downloaded file, or 'git-repo' for a cloned Git repository.","triggerScenarios":".chezmoiexternal entry contains type set to a string other than archive, file, git-repo, archive-file, or executable — e.g. 'tar', 'zip', 'git', or a misspelling.","commonSituations":"Guessing type names instead of checking docs; copying config from another tool; capitalization mistakes like 'Archive'.","solutions":["Replace the type value with one of the valid values: archive, file, git-repo (or archive-file/executable combos per docs)","Check chezmoi's external documentation for the exact spelling and allowed combinations","Run chezmoi apply --dry-run to re-validate after fixing"],"exampleFix":"// before\n[.tools]\n    type = \"zip\"\n    url = \"https://example.com/tool.zip\"\n// after\n[.tools]\n    type = \"archive\"\n    url = \"https://example.com/tool.zip\"","handlingStrategy":"validation","validationCode":"var validTypes = map[string]bool{\"archive\":true,\"file\":true,\"git-repo\":true,\"archive-file\":true,\"executable\":true}\nif !validTypes[ext.Type] { return fmt.Errorf(\"external %q has unknown type %q\", name, ext.Type) }","typeGuard":"func knownExternalType(t string) bool {\n    switch t { case \"archive\",\"file\",\"git-repo\",\"archive-file\",\"executable\": return true }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Copy type values from official docs verbatim","Use lowercase type strings exactly as documented","Add a config lint step for external types"],"tags":["config","external","invalid-value"],"backgroundTag":"unknown-external-type","analyzedSha":"f901167e4685db90da56d6a2a19df642cb3e0247","analyzedAt":"2026-09-01T18:16:41.508Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}