multica-ai/multica · error

backfill accountable_user_id batch: %w

Error message

backfill accountable_user_id batch: %w

What it means

Error "backfill accountable_user_id batch: %w" thrown in multica-ai/multica.

Source

Thrown at server/internal/attributionbackfill/backfill.go:190

	var res Result

	// Surface any genuinely mis-attributed rows (both users set but
	// different) up front. The invariant still forces accountable to follow
	// originator below, but the operator/audit trail should show the count.
	if err := pool.QueryRow(ctx, fmt.Sprintf(countMismatchSQL, table)).Scan(&res.MismatchNormalized); err != nil {
		return res, fmt.Errorf("count attribution mismatches: %w", err)
	}
	if res.MismatchNormalized > 0 {
		log.Warn("attribution backfill: normalizing rows where accountable_user_id disagreed with a non-NULL originator_user_id; originator is authoritative but these are worth auditing",
			"mismatch_rows", res.MismatchNormalized)
	}

	updateSQL := fmt.Sprintf(backfillBatchSQL, table, table)
	for {
		tag, err := pool.Exec(ctx, updateSQL, batchSize)
		if err != nil {
			return res, fmt.Errorf("backfill accountable_user_id batch: %w", err)
		}
		n := tag.RowsAffected()
		if n == 0 {
			break
		}
		res.RowsBackfilled += n
		res.Batches++
		log.Info("attribution backfill: batch reconciled",
			"rows", n,
			"total", res.RowsBackfilled)
	}

	if res.RowsBackfilled == 0 {
		log.Info("attribution backfill: no rows needed reconciliation before migration 198")
	} else {
		log.Info("attribution backfill: complete",
			"rows_backfilled", res.RowsBackfilled,
			"batches", res.Batches,

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Inspect the wrapped database error and re-run the backfill batch.

When it happens

Trigger: Thrown at server/internal/attributionbackfill/backfill.go:190 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/b44363118e317d02. Report an issue: GitHub.