{"record":{"id":"4fcb4ac726bbff34","repo":"siyuan-note/siyuan","slug":"199","errorCode":"199","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/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/notebook_bundle.go#L200-L236","documentation":"Thrown by ImportSYNotebookBundle while scanning a .sy.zip bundle: a manifest entry matched the bundle manifest path suffix, but its location is invalid — the manifest sits at the archive root (empty candidate), is nested deeper than one folder level (contains \"/\"), or more than one manifest was found (rootName already set). Localized as Conf.Language(199): invalid .sy.zip archive. The function returns bundle=true, telling the caller the archive claims to be a bundle but is malformed.","triggerScenarios":"Importing a .sy.zip that contains a manifest.json in two different folders or at the top level. Typically produced by hand-repacking a bundle export or by tools that inject extra manifest files.","commonSituations":"Users re-zipping a bundle export with the wrong root level; archive tools adding duplicate metadata entries; merging two bundle exports into one zip.","solutions":["Re-export the notebook bundle from 设置 - 导出 - 导出 Notebook bundle so the layout is canonical","If repacking manually, keep exactly one manifest at <single-root>/manifest path and no second copy anywhere","Import plain single-notebook .sy.zip exports through the normal import flow instead of the bundle path"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ids, bundle, err := model.ImportSYNotebookBundle(zipPath)\nif err != nil {\n    if err.Error() == Conf.Language(199) && bundle {\n        // bundle claims to be one but its manifest layout is invalid: re-export from SiYuan\n    }\n    return err\n}","preventionTips":["Only import .sy.zip bundles produced by the kernel's own export, unmodified","When repacking, keep exactly one manifest at the single declared root folder","Never merge multiple bundle exports into a single archive"],"tags":["import","zip","bundle","manifest","validation","siyuan"],"backgroundTag":"archive-manifest-invalid","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}