siyuan-note/siyuan · error

attribute view item [ ] not found

Error message

attribute view item [%s] not found

What it means

After validating count, getAttributeViewPasteRowsFromTable scans table.Rows for the row whose ID equals startItemID to use as the paste anchor. If no row matches (start remains -1), the anchor item no longer exists in this table and this error is returned.

Solutions

  1. Re-fetch the current rows and re-select a valid startItemID before pasting
  2. Check the row still exists (matching row.ID) before issuing the paste request
  3. Fall back to appending at the end of the table when the anchor cannot be found, if product logic allows

Example fix

// before
const startItemID = staleSelection.rowID
// after
if (!table.Rows.some(r => r.id === staleSelection.rowID)) { return fallbackAppendAtEnd() }
const startItemID = staleSelection.rowID
Defensive patterns

Strategy: validation

Validate before calling

const anchor = table.rows.find(r => r.id === startItemID)
if (!anchor) { throw new Error(`anchor row ${startItemID} no longer exists`) }

Try / catch

rows, err := getAttributeViewPasteRowsFromTable(table, startItemID, count)
if err != nil && strings.Contains(err.Error(), "attribute view item [") {
    rows, err = appendAtTableEnd(table, pastedData) // fallback
}

Prevention

When it happens

Trigger: Calling GetAttributeViewPasteRows with a startItemID that was deleted, or that belongs to a different view/group than the one being searched.

Common situations: Concurrent editing removed the anchor row between UI interaction and API call; startItemID taken from a stale selection; anchoring on a row in another group of a grouped view.

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/75f46c191af8e33f. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/attribute_view_render.go:396

			ret[keyValues.Key.Rollup.KeyID] = struct{}{}
		}
	}
	return
}

func getAttributeViewPasteRowsFromTable(table *av.Table, startItemID string, count int) (rows []*av.TableRow, err error) {
	if count < 1 {
		return nil, fmt.Errorf("invalid paste row count [%d]", count)
	}
	start := -1
	for i, row := range table.Rows {
		if row.ID == startItemID {
			start = i
			break
		}
	}
	if 0 > start {
		return nil, fmt.Errorf("attribute view item [%s] not found", startItemID)
	}
	end := start + min(count, len(table.Rows)-start)
	return table.Rows[start:end], nil
}

func RenderAttributeViewWithTarget(blockID, avID, viewID, query string, page, pageSize int, groupPaging map[string]any, initialLayout av.LayoutType, createIfNotExist, ignoreRows bool, targetItemID, targetGroupID string) (viewable av.Viewable, attrView *av.AttributeView, target *AttributeViewRenderTarget, err error) {
	if !ast.IsNodeIDPattern(avID) {
		err = ErrInvalidID
		return
	}

	waitForSyncingStorages()

	avBoxID, exactBox, resolveErr := resolveAttributeViewCarrierBoxID(blockID)
	if nil != resolveErr {
		err = resolveErr
		return
	}

View on GitHub (pinned to 9f775e8a12)