siyuan-note/siyuan · error
check data.zip failed
Error message
check data.zip failed
What it means
Thrown by ImportData when filepath.Glob fails while checking the unzipped Data archive structure. After extracting the zip, the kernel globs for .sy files at the first nesting level (pattern */*.sy) to validate the archive layout. If Glob returns an error (distinct from an empty match), this generic error is returned. The underlying glob error is logged via logging.LogErrorf. Note: filepath.Glob can only return an error for a malformed pattern, which should not occur with the hardcoded pattern, so this is effectively a safety net.
Source
Thrown at kernel/model/import.go:1128
lockSync()
defer unlockSync()
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 errView on GitHub (pinned to 251596fc0d)
Solutions
- Check the kernel log for the specific glob error logged at import.go:1127.
- Verify the temp extraction directory exists and is accessible.
- Re-export the Data.zip and try again.
- If this recurs, check filesystem health on the volume used for temp extraction.
Defensive patterns
Strategy: try-catch
Try / catch
err := model.ImportData(zipPath)
if err != nil && err.Error() == "check data.zip failed" {
// Check kernel log for the specific glob error
logging.LogErrorf("data archive validation failed during glob check")
// Likely filesystem issue — suggest re-export or check disk health
} Prevention
- Re-export the Data.zip if validation fails.
- Verify filesystem health on the temp extraction volume.
- Ensure the temp directory is accessible and not being cleaned up by other processes.
When it happens
Trigger: Calling ImportData where filepath.Glob(filepath.Join(unzipPath, '*/*.sy')) returns a non-nil error at import.go:1125-1129. In practice this is nearly impossible since the pattern is a valid constant, but could theoretically fire on filesystem-level errors.
Common situations: Extremely rare in practice since the glob pattern is valid. Could theoretically occur on a severely corrupted filesystem where directory listing primitives fail. More likely seen in test environments with mocked filesystems.
Related errors
- read imported notebook conf [%s] failed: %w
- inspect imported notebook [%s] failed: %w
- This is not a valid Data archive. If the archive was exporte
- invalid import token
- no file found
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/05b192287db5c3ec.
Report an issue: GitHub.