{"record":{"id":"2cbcaa75ae2d6b36","repo":"siyuan-note/siyuan","slug":"this-is-not-a-valid-sy-zip-archive-if-the-archiv-2cbcaa","errorCode":null,"errorMessage":"This is not a valid .sy.zip archive. If the archive was exported from [Settings], please import it from [Settings]","messagePattern":"This is not a valid \\.sy\\.zip archive\\. If the archive was exported from \\[Settings\\], please import it from \\[Settings\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/notebook_bundle.go","lineNumber":240,"sourceCode":"\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}\n\tbundle = true\n\tmanifest := &syNotebookBundleManifest{}\n\tif err = gulu.JSON.UnmarshalJSON(manifestData, manifest); nil != err || manifest.Spec != syNotebookBundleSpec || len(manifest.Notebooks) < 1 {\n\t\terr = errors.New(Conf.Language(199))\n\t\treturn\n\t}\n\n\tunzipPath := filepath.Join(filepath.Dir(zipPath), strings.TrimSuffix(filepath.Base(zipPath), filepath.Ext(zipPath))+\"-bundle-\"+gulu.Rand.String(7))\n\tif err = gulu.Zip.Unzip(zipPath, unzipPath); nil != err {\n\t\treturn\n\t}\n\tdefer os.RemoveAll(unzipPath)\n\trootPath := filepath.Join(unzipPath, filepath.FromSlash(rootName))\n\tif !gulu.File.IsDir(rootPath) {\n\t\terr = errors.New(Conf.Language(199))\n\t\treturn\n\t}\n\n\tvar notebooks []*inspectedSYNotebook\n\tseenArchives := map[string]struct{}{}\n\tfor _, item := range manifest.Notebooks {\n\t\tarchivePath := path.Clean(\"/\" + item.Archive)","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/notebook_bundle.go#L222-L258","documentation":"Thrown by ImportSYNotebookBundle after locating the manifest: either gulu.JSON.UnmarshalJSON cannot parse the manifest bytes, or the parsed manifest's Spec does not equal syNotebookBundleSpec, or it lists zero notebooks. All three cases yield Conf.Language(199) (invalid .sy.zip archive) — the manifest exists but its content does not satisfy the bundle contract.","triggerScenarios":"Importing a .sy.zip whose manifest.json is truncated/corrupted, was written by a different (older/newer) spec version, or has an empty/removed \"notebooks\" array. Editing the manifest by hand or exporting from an incompatible SiYuan version are typical causes.","commonSituations":"Version skew between the exporting and importing SiYuan builds; manifest edited to remove a notebook leaving none; zip corruption during transfer (partial upload).","solutions":["Re-export the bundle on a current SiYuan version and import without modifying the archive","If you must inspect, verify manifest.json parses, its spec field matches the current kernel, and notebooks is non-empty","Check zip integrity (unzip -t) after transferring the file"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ids, bundle, err := model.ImportSYNotebookBundle(zipPath)\nif err != nil && err.Error() == Conf.Language(199) {\n    // manifest unparseable / wrong spec / no notebooks: verify with unzip -t, then re-export\n}","preventionTips":["Match exporting and importing SiYuan versions for bundle transfers","Do not hand-edit manifest.json fields such as spec or notebooks","Verify archive integrity (unzip -t) after downloading or transferring bundles"],"tags":["import","zip","bundle","manifest","json","siyuan"],"backgroundTag":"archive-manifest-invalid","analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}