{"record":{"id":"7da5e1b326472deb","repo":"siyuan-note/siyuan","slug":"conf-language-199-7da5e1","errorCode":null,"errorMessage":"Conf.Language(199)","messagePattern":"Conf\\.Language\\(199\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/notebook_bundle.go","lineNumber":218,"sourceCode":"\n// ImportSYNotebookBundle 导入批量笔记本包。普通 .sy.zip 返回 bundle=false，由原有导入流程继续处理。\nfunc ImportSYNotebookBundle(zipPath string) (boxIDs []string, bundle bool, err error) {\n\tarchive, openErr := zip.OpenReader(zipPath)\n\tif nil != openErr {\n\t\terr = openErr\n\t\treturn\n\t}\n\tvar manifestData []byte\n\trootName := \"\"\n\tmanifestSuffix := \"/\" + syNotebookBundleManifestPath\n\tfor _, file := range archive.File {\n\t\tif !strings.HasSuffix(file.Name, manifestSuffix) {\n\t\t\tcontinue\n\t\t}\n\t\tcandidateRoot := strings.TrimSuffix(file.Name, manifestSuffix)\n\t\tif candidateRoot == \"\" || strings.Contains(candidateRoot, \"/\") || rootName != \"\" {\n\t\t\t_ = archive.Close()\n\t\t\treturn nil, true, errors.New(Conf.Language(199))\n\t\t}\n\t\treader, readErr := file.Open()\n\t\tif nil != readErr {\n\t\t\t_ = archive.Close()\n\t\t\treturn nil, true, readErr\n\t\t}\n\t\tmanifestData, readErr = io.ReadAll(reader)\n\t\t_ = reader.Close()\n\t\tif nil != readErr {\n\t\t\t_ = archive.Close()\n\t\t\treturn nil, true, readErr\n\t\t}\n\t\trootName = candidateRoot\n\t}\n\t_ = archive.Close()\n\tif rootName == \"\" {\n\t\treturn nil, false, nil\n\t}","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/notebook_bundle.go#L200-L236","documentation":"ImportSYNotebookBundle scans a .sy.zip bundle for the bundle manifest. If multiple manifest files are found (rootName already set), or a candidate manifest root name is empty or contains '/', it aborts with Conf.Language(199) — 'This is not a valid .sy.zip archive. If the archive was exported from [Settings], please import it from [Settings]'. This enforces a single manifest at the archive root.","triggerScenarios":"Importing a zip that contains two manifest files (e.g. two notebooks/xxx-sy.zip manifest suffixes at different roots), or a manifest entry whose trimmed root name is empty or contains a '/' character.","commonSituations":"Re-zipping an exported bundle with extra nesting or duplicate files; concatenating two bundles into one archive; renaming files inside the zip so manifest paths include slashes.","solutions":["Re-export the notebook bundle from Settings - Export so the archive has exactly one root manifest","Open the zip and remove duplicate or misplaced manifest files so only one root-level manifest remains","If you meant to import a single-notebook .sy.zip, use the regular notebook import instead of bundle import","Do not rename entries inside the exported archive before importing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before import: verify the zip has exactly one root-level manifest entry\nr, _ := zip.OpenReader(zipPath)\ncount := 0\nfor _, f := range r.File {\n    if strings.HasSuffix(f.Name, manifestSuffix) { count++ }\n}\n// count must equal 1\n","typeGuard":null,"tryCatchPattern":"boxIDs, bundle, err := ImportSYNotebookBundle(zipPath)\nif err != nil {\n    model.ShowMsg(model.Conf.Language(199))\n    return\n}\n","preventionTips":["Import bundles exactly as exported — do not re-zip, merge, or rename entries","Never combine two bundles into a single zip","Use the regular notebook import for plain .sy.zip files"],"tags":["import","zip","bundle","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}