siyuan-note/siyuan · error

attribute view item [ ] not found

Error message

attribute view item [%s] not found

What it means

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.

Solutions

  1. Re-read the attribute view and use a row ID that currently exists in its block key values.
  2. Confirm you are passing the row's block ID (from the block key), not a view or field ID.
  3. Refresh the frontend table/kanban state and retry after the row is re-created if it was deleted.

Example fix

// before
await setCardCoverPosition(avID, "20240101-stale-row", ...);
// after
const rows = await getAttrViewBlocks(avID);
if (rows.some(r => r.id === rowID)) await setCardCoverPosition(avID, rowID, ...);
Defensive patterns

Strategy: validation

Validate before calling

const rows = await getAttrViewRows(avID);
if (!rows.some(r => r.id === rowID)) throw new Error(`row ${rowID} does not exist in ${avID}`);

Try / catch

try { await setCardCoverPosition(...); } catch (e) { if (String(e).includes("attribute view item") && String(e).includes("not found")) await refreshViewAndAbort(); else throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/ca76b5907e0434d4. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/attribute_view.go:2079

		return fmt.Errorf("invalid card cover source [%s]", data.Source)
	}
	if nil != data.Position {
		if "" == data.Position.Image || 32*1024 < len(data.Position.Image) {
			return errors.New("invalid card cover image")
		}
		if math.IsNaN(data.Position.X) || math.IsInf(data.Position.X, 0) ||
			math.IsNaN(data.Position.Y) || math.IsInf(data.Position.Y, 0) ||
			data.Position.X < 0 || 100 < data.Position.X || data.Position.Y < 0 || 100 < data.Position.Y {
			return fmt.Errorf("invalid card cover position [%v, %v]", data.Position.X, data.Position.Y)
		}
	}

	attrView, err := av.ParseAttributeView(operation.AvID)
	if nil != err {
		return
	}
	if nil == attrView.GetBlockValue(operation.RowID) {
		return fmt.Errorf("attribute view item [%s] not found", operation.RowID)
	}
	view, err := getAttrViewViewByBlockID(attrView, operation.BlockID)
	if nil != err {
		return
	}
	if av.LayoutTypeGallery != view.LayoutType && av.LayoutTypeKanban != view.LayoutType {
		return av.ErrWrongLayoutType
	}
	var source string
	if av.LayoutTypeGallery == view.LayoutType {
		source = av.CardCoverSource(view.Gallery.CoverFrom, view.Gallery.CoverFromAssetKeyID)
	} else {
		source = av.CardCoverSource(view.Kanban.CoverFrom, view.Kanban.CoverFromAssetKeyID)
	}
	if data.Source != source {
		return fmt.Errorf("card cover source [%s] does not match view [%s]", data.Source, view.ID)
	}
	if keyID := av.CardCoverSourceAssetKeyID(data.Source); "" != keyID {

View on GitHub (pinned to 9f775e8a12)