{"record":{"id":"05b192287db5c3ec","repo":"siyuan-note/siyuan","slug":"check-data-zip-failed","errorCode":null,"errorMessage":"check data.zip failed","messagePattern":"check data\\.zip failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import.go","lineNumber":1128,"sourceCode":"\n\tlockSync()\n\tdefer unlockSync()\n\n\tlogging.LogInfof(\"import data from [%s]\", zipPath)\n\tbaseName := filepath.Base(zipPath)\n\text := filepath.Ext(baseName)\n\tbaseName = strings.TrimSuffix(baseName, ext)\n\tunzipPath := filepath.Join(filepath.Dir(zipPath), baseName)\n\terr = gulu.Zip.Unzip(zipPath, unzipPath)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer os.RemoveAll(unzipPath)\n\n\tfiles, err := filepath.Glob(filepath.Join(unzipPath, \"*/*.sy\"))\n\tif err != nil {\n\t\tlogging.LogErrorf(\"check data.zip failed: %s\", err)\n\t\treturn errors.New(\"check data.zip failed\")\n\t}\n\tif 0 < len(files) {\n\t\treturn errors.New(Conf.Language(198))\n\t}\n\tdirs, err := os.ReadDir(unzipPath)\n\tif err != nil {\n\t\tlogging.LogErrorf(\"check data.zip failed: %s\", err)\n\t\treturn errors.New(\"check data.zip failed\")\n\t}\n\tif 1 != len(dirs) {\n\t\treturn errors.New(Conf.Language(198))\n\t}\n\n\ttmpDataPath := filepath.Join(unzipPath, dirs[0].Name())\n\ttmpDataEmojisPath := filepath.Join(tmpDataPath, \"emojis\")\n\tfilelock.Walk(tmpDataEmojisPath, func(path string, d fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":1110,"sourceCodeEnd":1146,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/import.go#L1110-L1146","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := model.ImportData(zipPath)\nif err != nil && err.Error() == \"check data.zip failed\" {\n    // Check kernel log for the specific glob error\n    logging.LogErrorf(\"data archive validation failed during glob check\")\n    // Likely filesystem issue — suggest re-export or check disk health\n}","preventionTips":["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."],"tags":["import","data-zip","io","validation","glob"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}