{"record":{"id":"7eefbeb3b9521d6a","repo":"siyuan-note/siyuan","slug":"conf-language-198","errorCode":null,"errorMessage":"Conf.Language(198)","messagePattern":"Conf\\.Language\\(198\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import.go","lineNumber":1289,"sourceCode":"\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\n\t\t}\n\t\tif d == nil {\n\t\t\treturn nil","sourceCodeStart":1271,"sourceCodeEnd":1307,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/import.go#L1271-L1307","documentation":"ImportData requires the zip to contain exactly one top-level directory (the data folder). If the glob */*.sy finds document files directly under a first-level subdirectory — i.e. notebooks were not nested under a single data root — the layout is rejected with localized message 198 (Conf.Language(198)), which tells the user the data.zip structure is wrong.","triggerScenarios":"ImportData with a zip whose structure is data/<notebookID>/*.sy instead of data/<single-root>/<notebookID>/*.sy, or a zip of a single notebook's files rather than a full data folder.","commonSituations":"Zipping notebook folders directly instead of the whole data directory; using 'Export data.zip' incorrectly; hand-built zips missing the wrapping root folder.","solutions":["Repack the zip so all notebook folders live under exactly one root directory (the data folder content)","Use SiYuan's own 'Export data.zip' / settings-based export instead of manually zipping","Remove stray .sy files at data/<name>/*.sy level and re-zip","Verify structure: unzip should yield a single directory containing notebook-ID folders"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify zip layout: no .sy files at the second level\nfiles, _ := filepath.Glob(filepath.Join(extractRoot, \"*/*.sy\"))\nif len(files) > 0 {\n  return errors.New(\"zip layout invalid: .sy files not nested under data root\")\n}","typeGuard":null,"tryCatchPattern":"if err := ImportData(zipPath); err != nil {\n  if err.Error() == langMsg198 {\n    // repack the zip with a single wrapping data root and retry\n  }\n}","preventionTips":["Zip the content of the data folder under one single root directory","Prefer SiYuan's built-in export over manual zipping","Preview the zip structure before importing","Do not zip individual notebook folders as if they were full data"],"tags":["import","zip-layout","user-input","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}