siyuan-note/siyuan · error
Conf.Language(242)
Error message
Conf.Language(242)
What it means
SiYuan's ExportDataInFolder checks free disk space before exporting the whole workspace data as a zip. If the temp directory has less than 2x the data size free (needed for zipping), it fails with the localized message 242 (insufficient disk space), embedding current free space and required space via humanize.BytesCustomCeil.
Solutions
- Free disk space on the temp volume (set TEMP/TMP to a larger volume or clean util.TempDir)
- Reduce workspace size (purge assets/history) before export
- Export to a location where temp and target both have >= 2x data size free
Example fix
// before (fails when temp free < 2x data)
err = fmt.Errorf(Conf.Language(242), humanize.BytesCustomCeil(tempExportFree, 2), humanize.BytesCustomCeil(uint64(dataSize)*2, 2))
// after (caller): point temp at a volume with sufficient space
os.Setenv("TMPDIR", "/mnt/bigdisk/tmp") // ensure >= 2 * dataSize free Defensive patterns
Strategy: validation
Validate before calling
_, _, free := util.GetDiskUsage(util.TempDir)
if int64(free) < 2*dataSize { return fmt.Errorf("need %d bytes free in temp", 2*dataSize) } Try / catch
if err := model.ExportDataInFolder(folder); err != nil {
// localized 242: check free space message and free disk space before retry
} Prevention
- Monitor free space on the temp volume (keep > 2x workspace size)
- Point TMPDIR/TEMP at a large volume for big workspaces
- Clean util.TempDir regularly
When it happens
Trigger: Calling the data-export API with an export folder when util.TempDir free space < 2 * workspace data size. Happens on nearly-full disks or very large workspaces.
Common situations: Exporting a multi-GB workspace to a laptop disk with only a few GB free; export drive/temp on a small partition; snapshots/logs filling the temp volume.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- Conf.Language(242) (insufficient disk space: free, required)
- Export failed
- Conf.Language(14) (copy assets failed: )
- Conf.Language(14) (copy data dir failed: )
- Conf.Language(14) (copy docx failed: )
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/7144ed9329d36d15.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/export.go:723
return
}
util.PushEndlessProgress(Conf.Language(65))
defer util.ClearPushProgress(100)
data := filepath.Join(util.WorkspaceDir, "data")
if util.ContainerStd == util.Container {
// 桌面端检查磁盘可用空间
dataSize, sizeErr := util.SizeOfDirectory(data)
if sizeErr != nil {
logging.LogErrorf("get size of data dir [%s] failed: %s", data, sizeErr)
err = sizeErr
return
}
_, _, tempExportFree := util.GetDiskUsage(util.TempDir)
if int64(tempExportFree) < dataSize*2 { // 压缩 zip 文件时需要 data 的两倍空间
err = fmt.Errorf(Conf.Language(242), humanize.BytesCustomCeil(tempExportFree, 2), humanize.BytesCustomCeil(uint64(dataSize)*2, 2))
return
}
_, _, targetExportFree := util.GetDiskUsage(exportFolder)
if int64(targetExportFree) < dataSize { // 复制 zip 最多需要 data 一样的空间
err = fmt.Errorf(Conf.Language(242), humanize.BytesCustomCeil(targetExportFree, 2), humanize.BytesCustomCeil(uint64(dataSize), 2))
return
}
}
zipPath, err := ExportData()
if err != nil {
return
}
name = filepath.Base(zipPath)
name, err = url.PathUnescape(name)
if err != nil {
logging.LogErrorf("url unescape [%s] failed: %s", name, err)View on GitHub (pinned to 9f775e8a12)