{"record":{"id":"07b8d46acca15409","repo":"siyuan-note/siyuan","slug":"clone-attribute-view-item-failed","errorCode":null,"errorMessage":"clone attribute view item failed","messagePattern":"clone attribute view item failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_new_item.go","lineNumber":297,"sourceCode":"\t\tvar cleanupErr error\n\t\tfor _, item := range items {\n\t\t\t_, _, detachErr := replaceAttributeViewBlock(avID, item.itemID, \"\", true, nil)\n\t\t\tcleanupErr = errors.Join(cleanupErr, detachErr)\n\t\t\t_, restoreErr := UpdateAttributeViewCell(nil, avID, item.original.KeyID, item.itemID, item.original)\n\t\t\tcleanupErr = errors.Join(cleanupErr, restoreErr)\n\t\t}\n\t\tcleanupErr = errors.Join(cleanupErr, cleanupCreatedDocs())\n\t\tReloadAttrView(avID)\n\t\treturn nil, newItemCreationError(err, cleanupErr)\n\t}\n\tret.Transaction = tx\n\treturn ret, nil\n}\n\nfunc newBoundAttributeViewItemValue(original *av.Value, docID, icon string) (*av.Value, error) {\n\tbound := original.Clone()\n\tif nil == bound || nil == bound.Block {\n\t\treturn nil, errors.New(\"clone attribute view item failed\")\n\t}\n\tbound.IsDetached = false\n\tbound.Block.ID = docID\n\tbound.Block.Content = \"\"\n\tbound.Block.Icon = icon\n\treturn bound, nil\n}\n\nfunc lockAttributeViewItemDocs(avID string) func() {\n\tlockValue, _ := attributeViewItemDocsLocks.LoadOrStore(avID, &sync.Mutex{})\n\tlock := lockValue.(*sync.Mutex)\n\tlock.Lock()\n\treturn lock.Unlock\n}\n\nfunc attributeViewItemDocumentTemplate(attrView *av.AttributeView, saveMode string) (*av.NewItemTemplate, error) {\n\tswitch saveMode {\n\tcase CreateAttributeViewItemDocsSaveModeSubDoc:","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view_new_item.go#L279-L315","documentation":"Error \"clone attribute view item failed\" thrown in siyuan-note/siyuan.","triggerScenarios":"A database row clone fails because the source item data or its block content could not be copied.","commonSituations":"Occurs when adding a new row from a template fails during the block-clone step, for example when the template document was removed mid-operation.","solutions":["Retry the operation; check the kernel log for the root cause of the clone failure.","Verify the attribute view and its source blocks are intact (rebuild the attribute view if corrupted)."],"exampleFix":"Close other editors of the same database, reload, and repeat the row duplication.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}