siyuan-note/siyuan · error

Conf.Language(14)

Error message

Conf.Language(14)

What it means

exportData (invoked via ExportData) wraps any failure of filelock.Copy of the workspace data directory into the localized generic message 14. It is a pass-through wrapper: the original OS error (e.g. permission denied, I/O error) is logged and appended to the localized text.

Solutions

  1. Read the appended err.Error() detail to find the actual failing file/cause
  2. Verify OS read permission on the workspace data dir and write permission on the export folder
  3. Exclude/close processes locking the files (AV, backup tools) and retry

Example fix

// diagnose the wrapped cause
if err := model.ExportData(); err != nil {
    log.Printf("export failed, wrapped cause: %v", err) // message 14 + underlying copy error
}
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := os.Stat(filepath.Join(util.WorkspaceDir, "data")); err != nil { return err }
if f, err := os.Create(filepath.Join(exportFolder, ".wtest")); err == nil { f.Close(); os.Remove(f.Name()) } else { return err }

Try / catch

if _, err := model.ExportData(); err != nil {
    log.Printf("export failed: %v", err) // localized 14 wraps the real copy error
}

Prevention

When it happens

Trigger: ExportData called while copying util.WorkspaceDir/data to the export folder fails — source unreadable, destination not writable, file locked, or disk error mid-copy.

Common situations: Export target on read-only media; antivirus/file watcher locking .sy files; broken files in data dir; running without OS permissions on the data dir.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/6648c35a72abe794. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/export.go:792

func exportData(exportFolder string) (zipPath string, err error) {
	FlushTxQueue()
	if err = EnsureAllSyncAssets(); err != nil {
		return
	}

	logging.LogInfof("exporting data...")

	baseFolderName := "data-" + util.CurrentTimeSecondsStr()
	if err = os.MkdirAll(exportFolder, 0755); err != nil {
		logging.LogErrorf("create export temp folder failed: %s", err)
		return
	}

	data := filepath.Join(util.WorkspaceDir, "data")
	if err = filelock.Copy(data, exportFolder); err != nil {
		logging.LogErrorf("copy data dir from [%s] to [%s] failed: %s", data, baseFolderName, err)
		err = fmt.Errorf(Conf.Language(14), err.Error())
		return
	}

	zipPath = exportFolder + ".zip"
	zip, err := gulu.Zip.Create(zipPath)
	if err != nil {
		logging.LogErrorf("create export data zip [%s] failed: %s", exportFolder, err)
		return
	}

	zipCallback := func(filename string) {
		util.PushEndlessProgress(Conf.language(65) + " " + fmt.Sprintf(Conf.language(253), filename))
	}

	if err = zip.AddDirectory(baseFolderName, exportFolder, zipCallback); err != nil {
		logging.LogErrorf("create export data zip [%s] failed: %s", exportFolder, err)
		return
	}

View on GitHub (pinned to 9f775e8a12)