siyuan-note/siyuan · error
Conf.Language(313)
Error message
Conf.Language(313)
What it means
This error is raised in importSY0 when importing a .sy.zip archive into an encrypted notebook whose unzipped payload contains a storage/riff directory (spaced-repetition flashcard data). Encrypted notebooks do not support importing flashcard data, so the import aborts early with the localized message (i18n key 313: "Encrypted notebooks do not support this operation"). It is a deliberate guard, not a filesystem failure.
Solutions
- Remove the storage/riff directory from the import archive (or strip flashcard attributes) before importing into the encrypted notebook.
- Import into a non-encrypted notebook instead, then move/re-encrypt content manually if flashcards must be preserved.
- If flashcards are not needed, re-export the archive without flashcard/flashcard-embedded data and retry the import.
Example fix
// before: import zip containing storage/riff into encrypted box -> errors.New(Conf.Language(313))
// after: strip flashcard data before import
import { execSync } from "child_process";
execSync(`zip -d notebook.sy.zip "storage/riff/*"`); // then POST /api/import/importSY Defensive patterns
Strategy: validation
Validate before calling
// before importSY into a possibly-encrypted notebook
const ls = await (await fetch("/api/filetree/listDocsByPath", { method: "POST", body: JSON.stringify({ notebook: boxID, path: "/" }) })).json();
// check box encryption via export archive: unzip and test for storage/riff before posting
// e.g. unzip listing: zipinfo -1 notebook.sy.zip | grep '^storage/riff/' Try / catch
try { await importSY(boxID, zipPath); } catch (e) { if (e.msg.includes("do not support this operation")) { /* strip storage/riff and retry or retarget */ } else throw e; } Prevention
- Strip storage/riff from .sy.zip archives destined for encrypted notebooks.
- Keep flashcard-using content in non-encrypted notebooks.
- Check target notebook encryption status before scripted imports.
When it happens
Trigger: Calling importSY / ImportSYNotebookBundle (the /api/import/importSY endpoint) with a zip that contains storage/riff/ files, targeting an existing encrypted box (IsEncryptedBox(boxID) is true and the riff dir exists in the unzip root).
Common situations: User exports a .sy.zip from a normal notebook that has spaced-repetition data (riff cards) and re-imports it into an encrypted notebook; automated migration scripts moving notebooks to encryption-enabled workspaces.
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
- Conf.Language(386)
- Conf.Language(313)
- Conf.Language(313)
- Conf.Language(385)
- Encrypted notebooks do not support this operation
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/ebe09c043f92b8b0.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/import.go:477
boxConf := box.GetConf()
boxConf.Icon = filterBoxIcon(importedBoxConf.Icon)
boxConf.RefCreateSavePath = importedBoxConf.RefCreateSavePath
boxConf.DocCreateSavePath = importedBoxConf.DocCreateSavePath
boxConf.DocCreateTemplatePath = importedBoxConf.DocCreateTemplatePath
boxConf.DailyNoteSavePath = importedBoxConf.DailyNoteSavePath
boxConf.DailyNoteTemplatePath = importedBoxConf.DailyNoteTemplatePath
boxConf.SortMode = importedBoxConf.SortMode
if err = box.SaveConf(boxConf); err != nil {
return createdBoxID, err
}
}
} else {
createdBoxID = boxID
}
encryptedTarget := IsEncryptedBox(boxID)
storageRiffDir := filepath.Join(unzipRootPath, "storage", "riff")
if encryptedTarget && gulu.File.IsExist(storageRiffDir) {
return createdBoxID, errors.New(Conf.Language(313))
}
toPath = normalizeBoxDocTarget(boxID, toPath)
luteEngine := util.NewLute()
blockIDs := sharedBlockIDs
if nil == blockIDs {
blockIDs = map[string]string{}
}
trees := map[string]*parse.Tree{}
var importedSortDocs []*importedSYSortDoc
importedBoxDoc := false
containsFlashcardAttrs := false
// 重新生成块 ID
for i, syPath := range syPaths {
data, readErr := os.ReadFile(syPath)
if nil != readErr {
logging.LogErrorf("read .sy [%s] failed: %s", syPath, readErr)View on GitHub (pinned to 8641553a1f)