{"record":{"id":"05c642bd55804e98","repo":"twpayne/chezmoi","slug":"s-unsupported-mode-o-05c642","errorCode":null,"errorMessage":"%s: unsupported mode %o","messagePattern":"(.+?): unsupported mode %o","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/chezmoi/sourcestate.go","lineNumber":2593,"sourceCode":"\t\t\t\tType:       SourceFileTypeSymlink,\n\t\t\t}\n\t\t\tsourceRelPath := NewSourceRelPath(fileAttr.SourceName(s.encryption.EncryptedSuffix()))\n\t\t\ttargetStateEntry := &TargetStateSymlink{\n\t\t\t\tlinknameFunc: sync.OnceValues(func() (string, error) {\n\t\t\t\t\treturn linkname, nil\n\t\t\t\t}),\n\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:    parentSourceRelPath.Join(dirSourceRelPath, sourceRelPath),\n\t\t\t\ttargetStateEntry: targetStateEntry,\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%s: unsupported mode %o\", name, fileInfo.Mode()&fs.ModeType)\n\t\t}\n\t\tsourceStateEntries[targetRelPath] = append(sourceStateEntries[targetRelPath], sourceStateEntry)\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %s: %w\", externalRelPath, urlStr, err)\n\t}\n\n\treturn s.populateImplicitParentDirs(externalRelPath, external, sourceStateEntries), nil\n}\n\n// readExternalArchiveData reads an external archive's data and returns its data\n// and format.\nfunc (s *SourceState) readExternalArchiveData(\n\tctx context.Context,\n\texternalRelPath RelPath,\n\texternal *External,\n\toptions *ReadOptions,\n) ([]byte, string, ArchiveFormat, error) {","sourceCodeStart":2575,"sourceCodeEnd":2611,"githubUrl":"https://github.com/twpayne/chezmoi/blob/f901167e4685db90da56d6a2a19df642cb3e0247/internal/chezmoi/sourcestate.go#L2575-L2611","documentation":"Returned during archive walk when an entry's fs.ModeType is neither a regular file, directory, nor symlink that chezmoi knows how to map into source state entries. The octal mode-type bits are included for diagnosis.","triggerScenarios":"An external archive contains a special file type (e.g. device node, named pipe/FIFO, socket) which readExternalArchive's switch has no case for.","commonSituations":"Archive built from a full system tree including /dev entries or fifos; unusual packaging that embeds sockets; archives generated by tools that include special files.","solutions":["Rebuild/repackage the external archive to contain only regular files, directories, and symlinks","Filter out special files from the upstream archive before hosting it","Switch to a different external source/mirror whose archive has only standard entries"],"exampleFix":"// before: archive includes a FIFO\n$ tar -czf tool.tar.gz tool/ tool/pipe  # pipe is a fifo\n// after\n$ tar -czf tool.tar.gz tool/ --exclude=tool/pipe","handlingStrategy":"fallback","validationCode":"// inspect archive for special file types before use\nout, _ := exec.Command(\"tar\", \"-tvf\", archivePath).Output()\nfor _, line := range strings.Split(string(out), \"\\n\") {\n    if strings.ContainsAny(line[:1], \"pbcs\") { return fmt.Errorf(\"special file in archive: %s\", line) }\n}","typeGuard":null,"tryCatchPattern":"if err := apply(); err != nil && strings.Contains(err.Error(), \"unsupported mode\") {\n    switchToCleanMirrorURL() // fallback external without special files\n}","preventionTips":["Repackage upstream archives excluding devices/fifos/sockets","Prefer release archives built from source trees, not full system backups","Audit archives with tar -tv before hosting them for externals"],"tags":["archive","filesystem","external"],"backgroundTag":"unsupported-file-type","analyzedSha":"f901167e4685db90da56d6a2a19df642cb3e0247","analyzedAt":"2026-09-01T18:16:41.508Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}