siyuan-note/siyuan · error
This is not a valid .sy.zip archive. If the archive was expo
Error message
This is not a valid .sy.zip archive. If the archive was exported from [Settings], please import it from [Settings]
What it means
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.
Source
Thrown at kernel/model/notebook_bundle.go:240
_ = archive.Close()
return nil, true, readErr
}
manifestData, readErr = io.ReadAll(reader)
_ = reader.Close()
if nil != readErr {
_ = archive.Close()
return nil, true, readErr
}
rootName = candidateRoot
}
_ = archive.Close()
if rootName == "" {
return nil, false, nil
}
bundle = true
manifest := &syNotebookBundleManifest{}
if err = gulu.JSON.UnmarshalJSON(manifestData, manifest); nil != err || manifest.Spec != syNotebookBundleSpec || len(manifest.Notebooks) < 1 {
err = errors.New(Conf.Language(199))
return
}
unzipPath := filepath.Join(filepath.Dir(zipPath), strings.TrimSuffix(filepath.Base(zipPath), filepath.Ext(zipPath))+"-bundle-"+gulu.Rand.String(7))
if err = gulu.Zip.Unzip(zipPath, unzipPath); nil != err {
return
}
defer os.RemoveAll(unzipPath)
rootPath := filepath.Join(unzipPath, filepath.FromSlash(rootName))
if !gulu.File.IsDir(rootPath) {
err = errors.New(Conf.Language(199))
return
}
var notebooks []*inspectedSYNotebook
seenArchives := map[string]struct{}{}
for _, item := range manifest.Notebooks {
archivePath := path.Clean("/" + item.Archive)View on GitHub (pinned to afa823b6b4)
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
Defensive patterns
Strategy: try-catch
Try / catch
ids, bundle, err := model.ImportSYNotebookBundle(zipPath)
if err != nil && err.Error() == Conf.Language(199) {
// manifest unparseable / wrong spec / no notebooks: verify with unzip -t, then re-export
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Version skew between the exporting and importing SiYuan builds; manifest edited to remove a notebook leaving none; zip corruption during transfer (partial upload).
Related errors
- 199
- This archive contains notebook data. Please import it from [
- This is not a valid .sy.zip archive. If the archive was expo
- Query notebook failed
- Encrypted notebooks do not support this operation
AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18).
Data as JSON: /api/errors/2cbcaa75ae2d6b36.
Report an issue: GitHub.