{"record":{"id":"2249ef25694882f6","repo":"siyuan-note/siyuan","slug":"encrypted-attribute-view-snapshot-has-no-matching","errorCode":null,"errorMessage":"encrypted attribute view snapshot has no matching notebook [%s]","messagePattern":"encrypted attribute view snapshot has no matching notebook \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_render.go","lineNumber":1498,"sourceCode":"\t}\n\tattrView.CustomColorRenderContext = newHistoryAttributeViewCustomColorRenderContext(source.historyDir)\n\tattrView.ResolveDirectColors()\n\n\tviewable, err = renderAttributeView(attrView, \"\", viewID, carrierViewID, query, page, pageSize, groupPaging, false, false, nil, \"\")\n\treturn\n}\n\nfunc decryptHistoricalAttributeView(boxID, avID string, data []byte) ([]byte, error) {\n\tciphertext := util.IsCiphertext(data)\n\tif boxID == \"\" {\n\t\tif ciphertext {\n\t\t\treturn nil, errors.New(\"encrypted attribute view snapshot is missing notebook context\")\n\t\t}\n\t\treturn data, nil\n\t}\n\tif !IsEncryptedBox(boxID) {\n\t\tif ciphertext {\n\t\t\treturn nil, fmt.Errorf(\"encrypted attribute view snapshot has no matching notebook [%s]\", boxID)\n\t\t}\n\t\treturn data, nil\n\t}\n\tif !ciphertext {\n\t\treturn nil, fmt.Errorf(\"encrypted notebook attribute view snapshot is plaintext [%s]\", boxID)\n\t}\n\treturn av.DecryptAVData(boxID, avID, data)\n}\n","sourceCodeStart":1480,"sourceCodeEnd":1507,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/attribute_view_render.go#L1480-L1507","documentation":"decryptHistoricalAttributeView checks snapshot/notebook consistency. The snapshot was found under a specific notebook (boxID), but that notebook is not marked as encrypted while the snapshot payload IS ciphertext. There is no key available for a non-encrypted notebook, so decryption is impossible and this error is returned, including the offending boxID.","triggerScenarios":"Viewing history of an attribute view whose file is ciphertext but whose containing notebook in the snapshot is not an encrypted box — e.g. the notebook was toggled from encrypted to plain (or vice versa) after the snapshot was written, or the AV file was copied from an encrypted notebook into a plain notebook's history directory.","commonSituations":"Changing notebook encryption mode while old history snapshots retain the previous layout; manually copying storage/av files between notebooks of different encryption settings; restoring partial history data across notebooks.","solutions":["Restore the notebook's encryption setting to match the snapshot's era (the notebook must be encrypted to read ciphertext snapshots).","Find the snapshot copy under the notebook that was encrypted at that time and render history from that context instead.","Re-create the history snapshot from the currently correctly configured notebook.","Do not attempt to decrypt manually; use the encrypted-notebook recovery procedure in docs/ENCRYPTED-NOTEBOOK.md."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await renderHistoryAttributeView(avID, created);\n} catch (e) {\n  if (String(e.msg).startsWith(\"encrypted attribute view snapshot has no matching notebook\")) {\n    // restore the notebook's encrypted state or locate the snapshot under the originally encrypted notebook\n  }\n}","preventionTips":["Do not toggle notebook encryption mode while old history snapshots remain in use","Never copy storage/av files between notebooks with different encryption settings"],"tags":["go","encryption","attribute-view","notebook"],"backgroundTag":"missing-credentials","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}