{"record":{"id":"ebe09c043f92b8b0","repo":"siyuan-note/siyuan","slug":"conf-language-313-ebe09c","errorCode":null,"errorMessage":"Conf.Language(313)","messagePattern":"Conf\\.Language\\(313\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import.go","lineNumber":477,"sourceCode":"\t\t\tboxConf := box.GetConf()\n\t\t\tboxConf.Icon = filterBoxIcon(importedBoxConf.Icon)\n\t\t\tboxConf.RefCreateSavePath = importedBoxConf.RefCreateSavePath\n\t\t\tboxConf.DocCreateSavePath = importedBoxConf.DocCreateSavePath\n\t\t\tboxConf.DocCreateTemplatePath = importedBoxConf.DocCreateTemplatePath\n\t\t\tboxConf.DailyNoteSavePath = importedBoxConf.DailyNoteSavePath\n\t\t\tboxConf.DailyNoteTemplatePath = importedBoxConf.DailyNoteTemplatePath\n\t\t\tboxConf.SortMode = importedBoxConf.SortMode\n\t\t\tif err = box.SaveConf(boxConf); err != nil {\n\t\t\t\treturn createdBoxID, err\n\t\t\t}\n\t\t}\n\t} else {\n\t\tcreatedBoxID = boxID\n\t}\n\tencryptedTarget := IsEncryptedBox(boxID)\n\tstorageRiffDir := filepath.Join(unzipRootPath, \"storage\", \"riff\")\n\tif encryptedTarget && gulu.File.IsExist(storageRiffDir) {\n\t\treturn createdBoxID, errors.New(Conf.Language(313))\n\t}\n\ttoPath = normalizeBoxDocTarget(boxID, toPath)\n\n\tluteEngine := util.NewLute()\n\tblockIDs := sharedBlockIDs\n\tif nil == blockIDs {\n\t\tblockIDs = map[string]string{}\n\t}\n\ttrees := map[string]*parse.Tree{}\n\tvar importedSortDocs []*importedSYSortDoc\n\timportedBoxDoc := false\n\tcontainsFlashcardAttrs := false\n\n\t// 重新生成块 ID\n\tfor i, syPath := range syPaths {\n\t\tdata, readErr := os.ReadFile(syPath)\n\t\tif nil != readErr {\n\t\t\tlogging.LogErrorf(\"read .sy [%s] failed: %s\", syPath, readErr)","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/import.go#L459-L495","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before: import zip containing storage/riff into encrypted box -> errors.New(Conf.Language(313))\n// after: strip flashcard data before import\nimport { execSync } from \"child_process\";\nexecSync(`zip -d notebook.sy.zip \"storage/riff/*\"`); // then POST /api/import/importSY","handlingStrategy":"validation","validationCode":"// before importSY into a possibly-encrypted notebook\nconst ls = await (await fetch(\"/api/filetree/listDocsByPath\", { method: \"POST\", body: JSON.stringify({ notebook: boxID, path: \"/\" }) })).json();\n// check box encryption via export archive: unzip and test for storage/riff before posting\n// e.g. unzip listing: zipinfo -1 notebook.sy.zip | grep '^storage/riff/'","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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."],"tags":["import","encrypted-notebook","flashcards","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}