siyuan-note/siyuan · error

Currently available space is

Error message

Currently available space is [%s], at least [%s] is required to perform this operation

What it means

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.

Solutions

  1. Free space on the volume hosting the TEMP directory (at least 2x the data dir size) and retry
  2. Point TEMP/TMP to a larger volume and restart the kernel, then retry
  3. Shrink the data being exported: remove unused assets, empty trash, clear history
Defensive patterns

Strategy: validation

Validate before calling

dataSize, _ := util.SizeOfDirectory(data)
_, _, tempFree := util.GetDiskUsage(util.TempDir)
if int64(tempFree) < dataSize*2 {
    // free space or relocate TEMP before exporting
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18). Data as JSON: /api/errors/e4668088f86451ea. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/export.go:686

func ExportDataInFolder(exportFolder string) (name string, err error) {
	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 afa823b6b4)