siyuan-note/siyuan · error

Conf.Language(199)

Error message

Conf.Language(199)

What it means

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.

Solutions

  1. Re-export the notebook bundle from Settings - Export so the archive has exactly one root manifest
  2. Open the zip and remove duplicate or misplaced manifest files so only one root-level manifest remains
  3. If you meant to import a single-notebook .sy.zip, use the regular notebook import instead of bundle import
  4. Do not rename entries inside the exported archive before importing
Defensive patterns

Strategy: try-catch

Validate before calling

// before import: verify the zip has exactly one root-level manifest entry
r, _ := zip.OpenReader(zipPath)
count := 0
for _, f := range r.File {
    if strings.HasSuffix(f.Name, manifestSuffix) { count++ }
}
// count must equal 1

Try / catch

boxIDs, bundle, err := ImportSYNotebookBundle(zipPath)
if err != nil {
    model.ShowMsg(model.Conf.Language(199))
    return
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/7da5e1b326472deb. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/notebook_bundle.go:218

// ImportSYNotebookBundle 导入批量笔记本包。普通 .sy.zip 返回 bundle=false,由原有导入流程继续处理。
func ImportSYNotebookBundle(zipPath string) (boxIDs []string, bundle bool, err error) {
	archive, openErr := zip.OpenReader(zipPath)
	if nil != openErr {
		err = openErr
		return
	}
	var manifestData []byte
	rootName := ""
	manifestSuffix := "/" + syNotebookBundleManifestPath
	for _, file := range archive.File {
		if !strings.HasSuffix(file.Name, manifestSuffix) {
			continue
		}
		candidateRoot := strings.TrimSuffix(file.Name, manifestSuffix)
		if candidateRoot == "" || strings.Contains(candidateRoot, "/") || rootName != "" {
			_ = archive.Close()
			return nil, true, errors.New(Conf.Language(199))
		}
		reader, readErr := file.Open()
		if nil != readErr {
			_ = 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
	}

View on GitHub (pinned to 9f775e8a12)