{"record":{"id":"81d981c2203518d8","repo":"siyuan-note/siyuan","slug":"conf-language-242-insufficient-disk-space-s-fr","errorCode":null,"errorMessage":"Conf.Language(242) (insufficient disk space: %s free, %s required)","messagePattern":"Conf\\.Language\\(242\\) \\(insufficient disk space: (.+?) free, (.+?) required\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":720,"sourceCode":"\t\treturn\n\t}\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":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/export.go#L702-L738","documentation":"ExportDataInFolder checks free disk space in the temp directory before zipping: the export needs roughly 2x the data size (zip compression). If temp free space < dataSize*2 it returns Conf.Language(242): 'Currently available space is [%s], at least [%s] is required to perform this operation'.","triggerScenarios":"Calling the export-data-to-folder API when util.TempDir has less than twice the workspace data size free.","commonSituations":"Exporting a large workspace to a nearly-full system disk; temp dir on a small partition (e.g. /tmp on a constrained volume); Windows drive C nearly full.","solutions":["Free disk space on the volume holding the temp directory","Point the temp directory (TMPDIR/TMP env or workspace temp) to a larger volume","Export a smaller data range or clean up workspace data (trash/history) first"],"exampleFix":"// before\nexport data to folder with 1GB data but only 1.5GB temp free\n// after\nfree temp volume or set TMPDIR to a drive with >2GB free, then retry","handlingStrategy":"validation","validationCode":"const dataBytes = await getWorkspaceDataSize();\nconst tempFree = (await getDiskUsage(tempDir)).free;\nif (tempFree < dataBytes * 2) throw new Error(`Temp volume needs >= ${formatBytes(dataBytes*2)} free`);","typeGuard":null,"tryCatchPattern":"try {\n  await exportDataInFolder(path);\n} catch (e) {\n  if (String(e.msg).includes(\"available space\")) showHint(\"Free temp-disk space and retry\");\n}","preventionTips":["Check free space on the temp volume before large exports","Keep TMPDIR on a volume with headroom >= 2x workspace data","Periodically clean workspace trash/history to shrink data size"],"tags":["disk-space","export","filesystem"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}