gastownhall/beads · error

conflict columns for table %s: %w

Error message

conflict columns for table %s: %w

What it means

After querying a dolt_conflicts_<table> system table, loadConflictRows calls rows.Columns() to learn the row shape; this error wraps that failure. It indicates the result set metadata could not be read even though the query succeeded, which is rare and usually signals a broken connection or driver-level problem.

Source

Thrown at internal/storage/versioncontrolops/automerge.go:106

	// same courtesy the config path pays for an otherwise-undiagnosable
	// supersession.
	lww []string
}

// loadConflictRows reads every live conflict row of table in raw scanned form.
func loadConflictRows(ctx context.Context, db DBConn, table string) ([]rawConflictRow, error) {
	if err := ValidateConflictTable(table); err != nil {
		return nil, err
	}
	rows, err := db.QueryContext(ctx, "SELECT * FROM `dolt_conflicts_"+table+"`") //nolint:gosec // table validated as an identifier above
	if err != nil {
		return nil, fmt.Errorf("query conflicts for table %s: %w", table, err)
	}
	defer func() { _ = rows.Close() }()

	cols, err := rows.Columns()
	if err != nil {
		return nil, fmt.Errorf("conflict columns for table %s: %w", table, err)
	}
	var out []rawConflictRow
	for rows.Next() {
		vals := make([]any, len(cols))
		ptrs := make([]any, len(cols))
		for i := range vals {
			ptrs[i] = &vals[i]
		}
		if err := rows.Scan(ptrs...); err != nil {
			return nil, fmt.Errorf("scan conflict row for table %s: %w", table, err)
		}
		out = append(out, rawConflictRow{cols: cols, vals: vals})
	}
	if err := rows.Err(); err != nil {
		return nil, fmt.Errorf("iterate conflicts for table %s: %w", table, err)
	}
	return out, nil
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Check and restore the Dolt connection, then retry the auto-resolve
  2. Update the mysql/dolt driver and server to compatible versions
  3. Retry the merge resolution; the conflict set is re-readable after reconnect
Defensive patterns

Strategy: retry

Validate before calling

if err := db.PingContext(ctx); err != nil {
    return fmt.Errorf("connection unhealthy before conflict resolution: %w", err)
}

Try / catch

err := versioncontrolops.TryAutoResolveMergeConflicts(ctx, db)
if err != nil && strings.Contains(err.Error(), "conflict columns for table") {
    // metadata read failed mid-stream: reconnect and retry once
    return retryAfterReconnect(ctx, db)
}

Prevention

When it happens

Trigger: Auto-merge resolution reads conflict rows and the driver fails to return column metadata for the conflicts result set — connection reset between QueryContext and Columns, or a driver/protocol error.

Common situations: Unstable network to a remote Dolt server; server killed mid-query; database driver version mismatch with the server protocol.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/25ed62bc97d7ce83. Report an issue: GitHub.