{"record":{"id":"87571dde1e2ec54b","repo":"siyuan-note/siyuan","slug":"exporting-special-files-is-not-supported","errorCode":null,"errorMessage":"exporting special files is not supported","messagePattern":"exporting special files is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":961,"sourceCode":"\t}\n\n\treturn filepath.WalkDir(source, func(current string, entry fs.DirEntry, walkErr error) error {\n\t\tif walkErr != nil {\n\t\t\treturn walkErr\n\t\t}\n\t\tif entry.Type()&os.ModeSymlink != 0 {\n\t\t\treturn errors.New(\"exporting symbolic links is not supported\")\n\t\t}\n\t\trelativePath, relErr := filepath.Rel(source, current)\n\t\tif relErr != nil {\n\t\t\treturn relErr\n\t\t}\n\t\ttarget := filepath.Join(destination, relativePath)\n\t\tif entry.IsDir() {\n\t\t\treturn os.MkdirAll(target, 0755)\n\t\t}\n\t\tif !entry.Type().IsRegular() {\n\t\t\treturn errors.New(\"exporting special files is not supported\")\n\t\t}\n\t\treturn copyExportFile(current, target)\n\t})\n}\n\n// copyExportFile 复制单个导出文件，并从加密资源容器恢复用户可见名称。\nfunc copyExportFile(source, destination string) error {\n\tboxID := ExtractBoxIDFromAssetsPath(source)\n\tif boxID != \"\" && IsEncryptedBox(boxID) {\n\t\tdiskName := filepath.Base(source)\n\t\tif originalName := LookupAssetOriginalName(boxID, diskName); originalName != \"\" {\n\t\t\tfileName := util.FilterFileName(filepath.Base(originalName))\n\t\t\tif fileName != \"\" && fileName != \".\" {\n\t\t\t\tdestination = uniqueExportFilePath(filepath.Join(filepath.Dir(destination), fileName))\n\t\t\t}\n\t\t}\n\t}\n\treturn copyAssetDecryptIfEncrypted(source, destination)","sourceCodeStart":943,"sourceCodeEnd":979,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/export.go#L943-L979","documentation":"copyExportResource's WalkDir rejects any directory entry that is neither a directory nor a regular file (devices, FIFOs, sockets, etc.) with 'exporting special files is not supported'. This prevents exporting OS special files that have no meaningful standalone representation in a zip.","triggerScenarios":"ExportResources on a folder containing a FIFO, device node, or socket — typically created by services using the assets folder for IPC, or by unusual restores.","commonSituations":"Apps writing named pipes into watched asset folders; container volumes exposing device nodes; test fixtures with mkfifo artifacts.","solutions":["Remove the special files from the exported folder before exporting","Point the export at folders that contain only regular files","Investigate the process creating FIFOs/sockets inside the workspace and move its runtime files elsewhere"],"exampleFix":"// before: folder contains a FIFO\nmkfifo assets/pipe && model.ExportResources([]string{\"assets\"})\n// after: keep runtime files out of assets\nmkfifo /tmp/pipe && model.ExportResources([]string{\"assets\"})","handlingStrategy":"validation","validationCode":"fi, err := os.Stat(path)\nif err == nil && !fi.Mode().IsRegular() && !fi.IsDir() { return errors.New(\"special file cannot be exported\") }","typeGuard":"func isRegularOrDir(path string) bool {\n    info, err := os.Lstat(path)\n    return err == nil && (info.IsDir() || info.Mode().IsRegular())\n}","tryCatchPattern":"if _, err := model.ExportResources(paths); err != nil {\n    // remove special files (FIFOs, sockets, devices) from the folder and retry\n}","preventionTips":["Keep runtime IPC files (FIFOs/sockets) outside the workspace","Audit asset folders for non-regular files before export","Fix processes writing special files into the data directory"],"tags":["special-files","export","filesystem"],"backgroundTag":"unsupported-operation","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}