{"record":{"id":"73b6f7fe4782af9a","repo":"siyuan-note/siyuan","slug":"erritemnotfound","errorCode":"ErrItemNotFound","errorMessage":"item not found","messagePattern":"item not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/av.go","lineNumber":1388,"sourceCode":"\t\tif err := os.MkdirAll(av, 0755); err != nil {\n\t\t\tlogging.LogErrorf(\"create attribute view dir failed: %s\", err)\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}\n\nfunc GetAttributeViewI18n(key string) string {\n\treturn util.AttrViewLangs[util.Lang][key].(string)\n}\n\nvar (\n\tErrAttributeViewNotFound  = errors.New(\"attribute view not found\")\n\tErrInvalidAttributeViewID = errors.New(\"invalid attribute view id\")\n\tErrInvalidBoxID           = errors.New(\"invalid box id\")\n\tErrViewNotFound           = errors.New(\"view not found\")\n\tErrKeyNotFound            = errors.New(\"key not found\")\n\tErrItemNotFound           = errors.New(\"item not found\")\n\tErrWrongLayoutType        = errors.New(\"wrong layout type\")\n\tErrInvalidColumnAlign     = errors.New(\"invalid column align\")\n\tErrSpecTooNew             = errors.New(\"attribute view spec is too new\")\n\tErrRichTextSpecMismatch   = errors.New(\"attribute view rich text requires storage spec 9\")\n\tErrFilterTooDeep          = errors.New(\"filter nesting depth exceeds the maximum allowed\")\n)\n\nconst (\n\tNodeAttrNameAvs        = \"custom-avs\"                  // 用于标记块所属的属性视图，逗号分隔 av id\n\tNodeAttrView           = \"custom-sy-av-view\"           // 用于标记块所属的属性视图视图 view id Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443\n\tNodeAttrVisibleViewIDs = \"custom-sy-av-visible-views\"  // 用于标记数据库块显示的视图 ID，逗号分隔\n\tNodeAttrContextFilter  = \"custom-sy-av-context-filter\" // 用于保存数据库块独有的上下文筛选配置\n\tNodeAttrViewStaticText = \"custom-sy-av-s-text\"         // 用于标记块所属的属性视图静态文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049\n\n\tNodeAttrViewNames = \"av-names\" // 用于临时标记块所属的属性视图名称，空格分隔\n)\n","sourceCodeStart":1370,"sourceCodeEnd":1405,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/av/av.go#L1370-L1405","documentation":"ErrItemNotFound signals that a block value/row (item) referenced by an id does not exist in the attribute view. Binding preflight (preflightAttributeViewCellBindings), binding replacement, and value updates raise it when GetBlockValue returns nil for the row id.","triggerScenarios":"UpdateAttributeViewValue with a row id that was deleted; replaceAttributeViewBinding when the original block value is gone; attribute_view_binding.go cloning the original value of a cell whose row no longer exists.","commonSituations":"A bound block was deleted (or its id changed via copy/paste) while database rows still reference it; interrupted sync removed rows but not bindings; plugin writes to a row id from an outdated snapshot.","solutions":["Check that the row/block id still exists (GetBlockValue != nil) before updating or binding","Clean up orphaned bindings/rows after block deletion in the same transaction","Refresh the attribute view snapshot before writing so stale ids are not used"],"exampleFix":"// before\noriginal := attrView.GetBlockValue(cell.RowID)\nvalue = original.Clone()\n// after\noriginal := attrView.GetBlockValue(cell.RowID)\nif original == nil {\n    return av.ErrItemNotFound\n}\nvalue = original.Clone()","handlingStrategy":"validation","validationCode":"if attrView.GetBlockValue(rowID) == nil {\n    return fmt.Errorf(\"row %s missing\", rowID)\n}","typeGuard":null,"tryCatchPattern":"if err := bindCells(...); err != nil {\n    if errors.Is(err, av.ErrItemNotFound) {\n        // drop the stale binding and resync rows\n    }\n}","preventionTips":["Delete bindings together with the referenced blocks in one transaction","Refresh row snapshots before writes","Ignore-or-clean orphaned ids after failed syncs"],"tags":["attribute-view","row-missing","binding"],"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"}