siyuan-note/siyuan · error

This is not a valid Data archive. If the archive was…

Error message

This is not a valid Data archive. If the archive was exported from [Documents], please import it from [Documents]

What it means

Error "This is not a valid Data archive. If the archive was exported from [Documents], please import it from [Documents]" thrown in siyuan-note/siyuan.

Solutions

  1. If this archive was exported from the document tree, import it via Document Tree - More - Import Notebook instead
  2. Use the Data archive (exported from Settings - Export - Data) when importing through Settings

When it happens

Trigger: Thrown at kernel/model/import.go:1157 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at kernel/model/import.go:1157

	logging.LogInfof("import data from [%s]", zipPath)
	baseName := filepath.Base(zipPath)
	ext := filepath.Ext(baseName)
	baseName = strings.TrimSuffix(baseName, ext)
	unzipPath := filepath.Join(filepath.Dir(zipPath), baseName)
	err = gulu.Zip.Unzip(zipPath, unzipPath)
	if err != nil {
		return
	}
	defer os.RemoveAll(unzipPath)

	files, err := filepath.Glob(filepath.Join(unzipPath, "*/*.sy"))
	if err != nil {
		logging.LogErrorf("check data.zip failed: %s", err)
		return errors.New("check data.zip failed")
	}
	if 0 < len(files) {
		return errors.New(Conf.Language(198))
	}
	dirs, err := os.ReadDir(unzipPath)
	if err != nil {
		logging.LogErrorf("check data.zip failed: %s", err)
		return errors.New("check data.zip failed")
	}
	if 1 != len(dirs) {
		return errors.New(Conf.Language(198))
	}

	tmpDataPath := filepath.Join(unzipPath, dirs[0].Name())
	tmpDataEmojisPath := filepath.Join(tmpDataPath, "emojis")
	filelock.Walk(tmpDataEmojisPath, func(path string, d fs.DirEntry, err error) error {
		if err != nil {
			return err
		}
		if d == nil {
			return nil

View on GitHub (pinned to afa823b6b4)