{"record":{"id":"ca76b5907e0434d4","repo":"siyuan-note/siyuan","slug":"attribute-view-item-s-not-found-ca76b5","errorCode":null,"errorMessage":"attribute view item [%s] not found","messagePattern":"attribute view item \\[(.+?)\\] not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view.go","lineNumber":2079,"sourceCode":"\t\treturn fmt.Errorf(\"invalid card cover source [%s]\", data.Source)\n\t}\n\tif nil != data.Position {\n\t\tif \"\" == data.Position.Image || 32*1024 < len(data.Position.Image) {\n\t\t\treturn errors.New(\"invalid card cover image\")\n\t\t}\n\t\tif math.IsNaN(data.Position.X) || math.IsInf(data.Position.X, 0) ||\n\t\t\tmath.IsNaN(data.Position.Y) || math.IsInf(data.Position.Y, 0) ||\n\t\t\tdata.Position.X < 0 || 100 < data.Position.X || data.Position.Y < 0 || 100 < data.Position.Y {\n\t\t\treturn fmt.Errorf(\"invalid card cover position [%v, %v]\", data.Position.X, data.Position.Y)\n\t\t}\n\t}\n\n\tattrView, err := av.ParseAttributeView(operation.AvID)\n\tif nil != err {\n\t\treturn\n\t}\n\tif nil == attrView.GetBlockValue(operation.RowID) {\n\t\treturn fmt.Errorf(\"attribute view item [%s] not found\", operation.RowID)\n\t}\n\tview, err := getAttrViewViewByBlockID(attrView, operation.BlockID)\n\tif nil != err {\n\t\treturn\n\t}\n\tif av.LayoutTypeGallery != view.LayoutType && av.LayoutTypeKanban != view.LayoutType {\n\t\treturn av.ErrWrongLayoutType\n\t}\n\tvar source string\n\tif av.LayoutTypeGallery == view.LayoutType {\n\t\tsource = av.CardCoverSource(view.Gallery.CoverFrom, view.Gallery.CoverFromAssetKeyID)\n\t} else {\n\t\tsource = av.CardCoverSource(view.Kanban.CoverFrom, view.Kanban.CoverFromAssetKeyID)\n\t}\n\tif data.Source != source {\n\t\treturn fmt.Errorf(\"card cover source [%s] does not match view [%s]\", data.Source, view.ID)\n\t}\n\tif keyID := av.CardCoverSourceAssetKeyID(data.Source); \"\" != keyID {","sourceCodeStart":2061,"sourceCodeEnd":2097,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/attribute_view.go#L2061-L2097","documentation":"After parsing the attribute view, setAttrViewCardCoverPosition verifies that the target row (operation.RowID) exists via GetBlockValue. If no block value exists for that row ID, the item is unknown to this attribute view and this error is returned. It prevents writing cover positions for rows that were deleted or belong to another view.","triggerScenarios":"doSetAttrViewCardCoverPosition with a row-id that is not a row of the attribute view (deleted row, wrong database, or a block ID from a different notebook).","commonSituations":"Stale client state after a row was removed by another client; passing a document block ID instead of the database row's block ID; syncing races where the row no longer exists locally.","solutions":["Re-read the attribute view and use a row ID that currently exists in its block key values.","Confirm you are passing the row's block ID (from the block key), not a view or field ID.","Refresh the frontend table/kanban state and retry after the row is re-created if it was deleted."],"exampleFix":"// before\nawait setCardCoverPosition(avID, \"20240101-stale-row\", ...);\n// after\nconst rows = await getAttrViewBlocks(avID);\nif (rows.some(r => r.id === rowID)) await setCardCoverPosition(avID, rowID, ...);","handlingStrategy":"validation","validationCode":"const rows = await getAttrViewRows(avID);\nif (!rows.some(r => r.id === rowID)) throw new Error(`row ${rowID} does not exist in ${avID}`);","typeGuard":null,"tryCatchPattern":"try { await setCardCoverPosition(...); } catch (e) { if (String(e).includes(\"attribute view item\") && String(e).includes(\"not found\")) await refreshViewAndAbort(); else throw e; }","preventionTips":["Re-read rows immediately before mutating them","Never cache row IDs across refreshes/syncs","Distinguish document block IDs from database row IDs"],"tags":["attribute-view","card-cover","row-not-found"],"backgroundTag":"record-not-found","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"}