{"record":{"id":"e4668088f86451ea","repo":"siyuan-note/siyuan","slug":"currently-available-space-is-s-at-least-s-i","errorCode":null,"errorMessage":"Currently available space is [%s], at least [%s] is required to perform this operation","messagePattern":"Currently available space is \\[(.+?)\\], at least \\[(.+?)\\] is required to perform this operation","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":686,"sourceCode":"\nfunc ExportDataInFolder(exportFolder string) (name string, err error) {\n\tutil.PushEndlessProgress(Conf.Language(65))\n\tdefer util.ClearPushProgress(100)\n\n\tdata := filepath.Join(util.WorkspaceDir, \"data\")\n\tif util.ContainerStd == util.Container {\n\t\t// 桌面端检查磁盘可用空间\n\n\t\tdataSize, sizeErr := util.SizeOfDirectory(data)\n\t\tif sizeErr != nil {\n\t\t\tlogging.LogErrorf(\"get size of data dir [%s] failed: %s\", data, sizeErr)\n\t\t\terr = sizeErr\n\t\t\treturn\n\t\t}\n\n\t\t_, _, tempExportFree := util.GetDiskUsage(util.TempDir)\n\t\tif int64(tempExportFree) < dataSize*2 { // 压缩 zip 文件时需要 data 的两倍空间\n\t\t\terr = fmt.Errorf(Conf.Language(242), humanize.BytesCustomCeil(tempExportFree, 2), humanize.BytesCustomCeil(uint64(dataSize)*2, 2))\n\t\t\treturn\n\t\t}\n\n\t\t_, _, targetExportFree := util.GetDiskUsage(exportFolder)\n\t\tif int64(targetExportFree) < dataSize { // 复制 zip 最多需要 data 一样的空间\n\t\t\terr = fmt.Errorf(Conf.Language(242), humanize.BytesCustomCeil(targetExportFree, 2), humanize.BytesCustomCeil(uint64(dataSize), 2))\n\t\t\treturn\n\t\t}\n\t}\n\n\tzipPath, err := ExportData()\n\tif err != nil {\n\t\treturn\n\t}\n\tname = filepath.Base(zipPath)\n\tname, err = url.PathUnescape(name)\n\tif err != nil {\n\t\tlogging.LogErrorf(\"url unescape [%s] failed: %s\", name, err)","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/export.go#L668-L704","documentation":"On desktop (ContainerStd), before zipping the data directory for export, the kernel measures the data dir size and requires the TEMP volume to have at least twice that much free space (zip compression needs the data plus headroom for the archive). If free < dataSize*2 it returns localized message 242 with the actual and required bytes for the temp location.","triggerScenarios":"Invoking the full data export (ExportData zip path) when the drive hosting TempDir (usually the system drive on Windows) has less than 2x the workspace data size free.","commonSituations":"Large workspaces with many assets on machines whose system/temp drive is nearly full; TEMP redirected to a small RAM disk or SSD partition smaller than the data drive.","solutions":["Free space on the volume hosting the TEMP directory (at least 2x the data dir size) and retry","Point TEMP/TMP to a larger volume and restart the kernel, then retry","Shrink the data being exported: remove unused assets, empty trash, clear history"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"dataSize, _ := util.SizeOfDirectory(data)\n_, _, tempFree := util.GetDiskUsage(util.TempDir)\nif int64(tempFree) < dataSize*2 {\n    // free space or relocate TEMP before exporting\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the TEMP volume stocked with at least 2x the workspace data size","Point TEMP to a large drive for big exports","Prune assets, trash, and history to shrink the data dir before exporting"],"tags":["disk-space","export","zip","temp-dir"],"backgroundTag":"insufficient-disk-space","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}