siyuan-note/siyuan · error
Conf.Language(373)
Error message
Conf.Language(373)
What it means
ImportSY rejects an archive whose contents are detected as a full notebook bundle (.sy.zip exported as a whole notebook) because the public ImportSY API is meant for importing document-level .sy files, not entire notebooks. The message comes from i18n key 373: 'This archive contains notebook data. Please import it from [Document Tree - More - Import Notebook]'.
Source
Thrown at kernel/model/import.go:157
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 8641553a1f)
Solutions
- Use ImportSYNotebook(zipPath) or ImportSYNotebookBundle instead of ImportSY for notebook archives
- Re-export only individual documents (.sy files) if the target is document import via ImportSY
- In the UI, import via Document Tree - More - Import Notebook as the message suggests
Example fix
// before
err := model.ImportSY(zipPath, boxID, toPath)
// after
if model.IsSYNotebookBundle(zipPath) {
boxID, err = model.ImportSYNotebook(zipPath)
} else {
err = model.ImportSY(zipPath, boxID, toPath)
} Defensive patterns
Strategy: validation
Validate before calling
// detect bundle type before choosing the import API
if isSYNotebookBundle(zipPath) {
return model.ImportSYNotebook(zipPath)
}
return model.ImportSY(zipPath, boxID, toPath) Try / catch
// Go caller
if err := model.ImportSY(zipPath, boxID, toPath); err != nil {
// message is localized (Language 373): retry with notebook import
if _, nbErr := model.ImportSYNotebook(zipPath); nbErr == nil {
return nil
}
return err
} Prevention
- Route notebook-level .sy.zip archives to ImportSYNotebook/ImportSYNotebookBundle, not ImportSY
- When exposing import UIs, detect archive type first instead of assuming document import
- Educate users on the two export types (document .sy vs notebook .sy.zip)
When it happens
Trigger: Calling model.ImportSY(zipPath, boxID, toPath) with a zipPath that isSYNotebookBundle identifies as a notebook export (contains notebook-level .siyuan/conf.json or notebook doc metadata instead of plain document .sy files).
Common situations: User (or plugin) picked the wrong import entry point — dragging a notebook-exported .sy.zip into a document import flow; automations calling the import API with a notebook archive; confusion between .sy.zip exported from the doc tree vs from Settings.
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
- Query notebook failed
- opened notebook [%s] not found
- ErrSYTargetNotebookRequired
- Conf.Language(199)
- invalid imported notebook document metadata
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/5b315a60076bf2f5.
Report an issue: GitHub.