{"record":{"id":"3f5d1e9e0c42c8fd","repo":"twpayne/chezmoi","slug":"s-path-not-found-in-s","errorCode":null,"errorMessage":"%s: path not found in %s","messagePattern":"(.+?): path not found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chezmoi/sourcestate.go","lineNumber":2739,"sourceCode":"\t\t\t\tsourceAttr: SourceAttr{\n\t\t\t\t\tExternal: true,\n\t\t\t\t},\n\t\t\t}\n\t\t\tsourceStateEntry = &SourceStateFile{\n\t\t\t\tattr:             fileAttr,\n\t\t\t\torigin:           external,\n\t\t\t\tsourceRelPath:    sourceRelPath,\n\t\t\t\ttargetStateEntry: targetStateEntry,\n\t\t\t}\n\t\t\treturn fs.SkipAll\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%s: unsupported mode %o\", name, fileInfo.Mode()&fs.ModeType)\n\t\t}\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\tif sourceStateEntry == nil {\n\t\treturn nil, fmt.Errorf(\"%s: path not found in %s\", external.ArchivePath, urlStr)\n\t}\n\n\treturn s.populateImplicitParentDirs(externalRelPath, external, map[RelPath][]SourceStateEntry{\n\t\texternalRelPath: {sourceStateEntry},\n\t}), nil\n}\n\n// readExternalDir returns all source state entries in an external_ dir.\nfunc (s *SourceState) readExternalDir(\n\trootSourceAbsPath AbsPath,\n\trootSourceRelPath SourceRelPath,\n\trootTargetRelPath RelPath,\n) (map[RelPath][]SourceStateEntry, error) {\n\tsourceStateEntries := make(map[RelPath][]SourceStateEntry)\n\twalkFunc := func(absPath AbsPath, fileInfo fs.FileInfo, err error) error {\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\treturn err","sourceCodeStart":2721,"sourceCodeEnd":2757,"githubUrl":"https://github.com/twpayne/chezmoi/blob/f901167e4685db90da56d6a2a19df642cb3e0247/internal/chezmoi/sourcestate.go#L2721-L2757","documentation":"After downloading an archive and walking it to find the entry matching external.ArchivePath, no entry matched, so sourceStateEntry stays nil and chezmoi raises 'path not found in <url>'. It means the configured archive path does not exist inside the downloaded archive.","triggerScenarios":".chezmoiexternal entry with archivePath (and often exactArchivePath) referencing a file/directory that does not exist in the archive at the given URL; path spelling, case, or stripComponents mismatch.","commonSituations":"Upstream project renamed or moved a file inside its release tarball; typo in archivePath; archive layout changed between versions (e.g. subdir added); pinning an old URL whose layout differs from your config.","solutions":["List the archive contents (tar -tzf / unzip -l <url-download>) and correct archivePath to an entry that actually exists","Check for typos and trailing-slash/case mismatches in the archivePath value","Pin the URL/version so the archive layout stays consistent, or update config after upstream layout changes"],"exampleFix":"// before\n[[external]]\n  url = \"https://github.com/x/y/archive/v2.tar.gz\"\n  archivePath = \"y-2/config/old-name\"  # renamed upstream\n// after\n  archivePath = \"y-2/config/new-name\"","handlingStrategy":"validation","validationCode":"// verify archivePath exists before configuring:\nurl=https://github.com/x/y/archive/v2.tar.gz\ncurl -sL \"$url\" -o /tmp/a.tgz && tar -tzf /tmp/a.tgz | grep 'y-2/config/'","typeGuard":null,"tryCatchPattern":"// wrap apply and report which external failed\nif err := chezmoiApply(); err != nil {\n  if strings.Contains(err.Error(), \"path not found in\") {\n    log.Fatalf(\"external archivePath mismatch: %v — list archive contents and fix archivePath\", err)\n  }\n  return err\n}","preventionTips":["List archive contents and match archivePath exactly (case, leading path after stripComponents)","Pin URLs/versions so upstream layout changes cannot break archivePath","Add a CI check that downloads the archive and greps for the configured path"],"tags":["chezmoi","archive","config"],"backgroundTag":"archive-path-not-found","analyzedSha":"f901167e4685db90da56d6a2a19df642cb3e0247","analyzedAt":"2026-09-01T18:16:41.508Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}