siyuan-note/siyuan · error

Conf.Language(373)

Error message

Conf.Language(373)

What it means

ImportSY refuses to import a zip that is itself an encrypted/plain SiYuan notebook bundle (isSYNotebookBundle detects the notebook-level .sy bundle structure). Notebook-level bundles must be imported with ImportSYNotebook/ImportSYAuto, not the into-existing-folder import path, because importing a whole notebook as a child document would corrupt the target structure. The message is the localized i18n string with key 373.

Solutions

  1. Detect the bundle type first (isSYNotebookBundle) and call ImportSYNotebook or ImportSYAuto for notebook bundles
  2. If importing from the UI, use the notebook-level import entry point instead of the within-notebook import
  3. If you only need the documents, re-export them as a document tree zip (not a notebook bundle) and import that

Example fix

// before
if err := model.ImportSY(zipPath, boxID, "/docs"); err != nil { ... }
// after
if isSYNotebookBundle(zipPath) {
    boxID, err = model.ImportSYNotebook(zipPath)
} else {
    err = model.ImportSY(zipPath, boxID, "/docs")
}
Defensive patterns

Strategy: validation

Validate before calling

if model.IsSYNotebookBundle(zipPath) { // route to ImportSYNotebook/ImportSYAuto instead of ImportSY }

Try / catch

if err := model.ImportSY(zipPath, boxID, toPath); err != nil && strings.Contains(err.Error(), Conf.Language(373)) { // fall back to notebook-level import }

Prevention

When it happens

Trigger: Calling model.ImportSY (or the API import endpoint routed to it) with zipPath pointing to a full notebook export bundle while also supplying boxID/toPath targeting a folder inside a notebook.

Common situations: Users dragging a whole-notebook export (.sy notebook zip) into the document-level import dialog; automation scripts that always call ImportSY regardless of bundle type.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at kernel/model/import.go:158

				n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("|"), []byte("\\|"))
				n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("\\<br /\\>"), []byte("<br />"))
			}
		case ast.NodeInlineMath:
			withMath = true
		case ast.NodeLinkDest:
			dest := n.TokensStr()
			if !options.SkipBase64Assets && strings.HasPrefix(dest, "data:image") && strings.Contains(dest, ";base64,") {
				processBase64Img(n, dest, assetDirPath, boxID)
			}
		}
		return ast.WalkContinue
	})
	return
}

func ImportSY(zipPath, boxID, toPath string) (err error) {
	if isSYNotebookBundle(zipPath) {
		return errors.New(Conf.Language(373))
	}
	_, err = importSY(zipPath, boxID, toPath, false, false)
	return
}

func ImportSYNotebook(zipPath string) (boxID string, err error) {
	return importSY(zipPath, "", "/", true, false)
}

var ErrSYTargetNotebookRequired = errors.New("target notebook required")

func ImportSYAuto(zipPath, boxID, toPath string) (createdBoxID string, notebook bool, err error) {
	createdBoxID, err = importSY(zipPath, boxID, toPath, false, true)
	notebook = err == nil && createdBoxID != boxID
	return
}

func isSYNotebookExport(hasBoxConf, hasBoxDocMeta bool) bool {

View on GitHub (pinned to 9f775e8a12)