{"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":1268,"sourceCode":"\tif err = av.CheckSpec(attrView); nil != err {\n\t\treturn\n\t}\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":1250,"sourceCodeEnd":1277,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view_render.go#L1250-L1277","documentation":"Thrown by decryptHistoricalAttributeView when a boxID was inferred from the path (so the file lives under a notebook directory) but that notebook is not registered as encrypted (IsEncryptedBox returns false), while the file content is ciphertext. The notebook's encryption context does not match the encrypted payload, so no key is available.","triggerScenarios":"An AV file sits under /<boxID>/storage/av/ and is encrypted, but the notebook <boxID> is not in the encrypted set. Occurs after a notebook was unencrypted but its AV files were left encrypted, or when a path segment that looks like a boxID is not actually a tracked encrypted notebook.","commonSituations":"Notebook encryption was disabled/removed without re-encrypting or migrating stored objects; or a repo/history path was rewritten so a non-notebook segment is mistaken for a boxID. The encryption metadata and the on-disk object are out of sync.","solutions":["Verify the notebook is actually encrypted via the notebook settings; if it was decrypted, run the migration so its AV files are decrypted too.","Confirm the boxID segment in the path is a real notebook ID and not a coincidental directory name.","If the notebook was never encrypted, the ciphertext file is orphaned; restore a known-good plaintext copy from backup."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// If you control the path, confirm the notebook is actually encrypted before relying on it.\nif boxID != \"\" && ciphertext && !model.IsEncryptedBox(boxID) {\n    // encryption metadata out of sync; do not attempt decrypt\n}","typeGuard":null,"tryCatchPattern":"data, err := decryptHistoricalAttributeView(boxID, avID, data)\nif err != nil {\n    if strings.Contains(err.Error(), \"no matching notebook\") {\n        // notebook not encrypted but file is; reconcile encryption state\n    }\n    return err\n}","preventionTips":["Keep notebook encryption metadata consistent with the on-disk object encryption state.","When disabling notebook encryption, migrate its stored objects to plaintext.","Verify the boxID segment of a path is a real notebook before treating it as an encryption context."],"tags":["attribute-view","encryption","data-integrity","notebook-context"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}