{"record":{"id":"b13ba903538eb3a0","repo":"twpayne/chezmoi","slug":"s-missing-path","errorCode":null,"errorMessage":"%s: missing path","messagePattern":"(.+?): missing path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chezmoi/sourcestate.go","lineNumber":2645,"sourceCode":"\tformat := external.Format\n\tif format == ArchiveFormatUnknown {\n\t\tformat = GuessArchiveFormat(urlPath, data)\n\t}\n\n\treturn data, urlStr, format, nil\n}\n\n// readExternalArchiveFile reads a file from an external archive and returns its\n// SourceStateEntries.\nfunc (s *SourceState) readExternalArchiveFile(\n\tctx context.Context,\n\texternalRelPath RelPath,\n\tparentSourceRelPath SourceRelPath,\n\texternal *External,\n\toptions *ReadOptions,\n) (map[RelPath][]SourceStateEntry, error) {\n\tif external.ArchivePath.IsEmpty() {\n\t\treturn nil, fmt.Errorf(\"%s: missing path\", externalRelPath)\n\t}\n\n\tdata, urlStr, format, err := s.readExternalArchiveData(ctx, externalRelPath, external, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar sourceStateEntry SourceStateEntry\n\tif err := WalkArchive(data, format, func(name RelPath, fileInfo fs.FileInfo, r io.Reader, linkname string) error {\n\t\tif external.StripComponents > 0 {\n\t\t\tcomponents := name.SplitAll()\n\t\t\tif len(components) <= external.StripComponents {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tname = NewRelPathFromComponents(components[external.StripComponents:]...)\n\t\t}\n\t\tswitch {\n\t\tcase name.IsEmpty():","sourceCodeStart":2627,"sourceCodeEnd":2663,"githubUrl":"https://github.com/twpayne/chezmoi/blob/f901167e4685db90da56d6a2a19df642cb3e0247/internal/chezmoi/sourcestate.go#L2627-L2663","documentation":"Returned by readExternalArchive when the external entry's archivePath field is empty, i.e. an entry that requires selecting a file within an archive has no path specified. chezmoi cannot know which member of the archive to extract.","triggerScenarios":"An external entry of type archive-file (or one using archive.path/executable selection) is configured without the path key, so external.ArchivePath.IsEmpty() is true.","commonSituations":"Using the executable/archive-file external style but forgetting the path; renaming config keys and dropping path; copying an archive-type entry and converting it incompletely.","solutions":["Add the path field naming the file inside the archive to extract","If the whole archive is wanted, change type to plain archive and remove the path expectation","Validate with chezmoi apply --dry-run after editing"],"exampleFix":"// before\n[.local/bin/jq]\n    type = \"archive-file\"\n    url = \"https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64\"\n// after\n[.local/bin/jq]\n    type = \"archive-file\"\n    url = \"https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64\"\n    path = \"jq\"","handlingStrategy":"validation","validationCode":"if ext.Type == \"archive-file\" && ext.Path == \"\" {\n    return fmt.Errorf(\"archive-file external %q requires a path\", name)\n}","typeGuard":"func archiveFileHasPath(e External) bool { return e.Type != \"archive-file\" || e.Path != \"\" }","tryCatchPattern":null,"preventionTips":["Always pair type=archive-file with a path value","List archive contents first to confirm the member name","Dry-run apply after editing externals"],"tags":["config","external","missing-field"],"backgroundTag":"missing-archive-path","analyzedSha":"f901167e4685db90da56d6a2a19df642cb3e0247","analyzedAt":"2026-09-01T18:16:41.508Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}