gastownhall/beads · warning
a %s conflict was not cleared (no conflict row deleted)
Error message
a %s conflict was not cleared (no conflict row deleted)
What it means
The DELETE ran successfully but deleted zero rows from dolt_conflicts_<table>, meaning the validated conflict row vanished between the check pass and the resolution. Deleting the conflict row is what marks it settled in dolt, so zero deletions mean the conflict could not be cleared and the resolution is refused rather than silently 'succeeding'.
Source
Thrown at internal/storage/versioncontrolops/automerge.go:719
for _, row := range plan {
preds := make([]string, 0, len(row.columns))
args := make([]any, 0, len(row.columns))
for i, k := range row.columns {
v := row.values[i]
if v == nil {
return fmt.Errorf("unexpected %s conflict row with no our_%s (safety check bypassed)", table, k)
}
preds = append(preds, "`our_"+k+"` = ?")
args = append(args, v)
}
//nolint:gosec // table and key columns come from the unionConflictKeyColumns allowlist.
stmt := "DELETE FROM `dolt_conflicts_" + table + "` WHERE " + strings.Join(preds, " AND ")
res, err := db.ExecContext(ctx, stmt, args...)
if err != nil {
return fmt.Errorf("clear %s conflict: %w", table, err)
}
if n, err := res.RowsAffected(); err == nil && n == 0 {
return fmt.Errorf("a %s conflict was not cleared (no conflict row deleted)", table)
}
}
return nil
}
View on GitHub (pinned to 71377f2769)
Solutions
- Re-run TryAutoResolveMergeConflicts so a fresh plan is built from current conflict state — the stale plan's rows are already gone.
- Serialize merge resolution: hold the repo lock or ensure only one process auto-resolves at a time.
- Check dolt conflict status to confirm the conflicts are actually resolved before treating this as a failure.
- If it recurs, look for concurrent automation (cron, CI, another agent session) touching the same working set.
Example fix
// before — retrying resolution with the same stale plan
if n == 0 { return fmt.Errorf("a %s conflict was not cleared (no conflict row deleted)", table) }
// after — rebuild the plan from live state and retry once
if n == 0 {
freshPlan, safe, err := unionConflictsAreSafe(ctx, db, table)
if err != nil { return err }
if safe { return resolveUnionConflicts(ctx, db, table, freshPlan) }
return nil // conflicts already gone or no longer auto-resolvable
} Defensive patterns
Strategy: retry
Validate before calling
// verify conflict rows still exist before deleting
for _, row := range plan {
var n int
args := row.values
if err := db.QueryRowContext(ctx,
"SELECT COUNT(*) FROM `dolt_conflicts_"+table+"` WHERE "+keyPreds(row.columns), args...).Scan(&n);
err == nil && n == 0 {
// stale plan: rebuild before resolving
}
} Try / catch
if err := resolveUnionConflicts(ctx, db, table, plan); err != nil {
if strings.Contains(err.Error(), "was not cleared") {
// plan is stale — rebuild from live conflict state and retry once
freshPlan, safe, err2 := unionConflictsAreSafe(ctx, db, table)
if err2 == nil && safe {
return resolveUnionConflicts(ctx, db, table, freshPlan)
}
return nil // conflicts already gone
}
return err
} Prevention
- Ensure only one process/session auto-resolves a repo's conflicts at a time.
- Rebuild the plan immediately before resolution; don't cache plans across operations.
- After the error, verify conflict state — it usually means another resolver already won.
- Avoid scheduling overlapping auto-merge jobs (cron/CI/agent sessions) on the same working set.
When it happens
Trigger: Another session resolved or deleted the same conflict rows after unionConflictsAreSafe loaded the plan but before resolveUnionConflicts executed its DELETE; a concurrent dolt_conflicts_resolve or merge cleared the table; the key values in the plan no longer match any row.
Common situations: Two agents or two machines auto-resolving the same repo simultaneously; a user ran dolt_conflicts_resolve --ours while auto-merge was in flight; the merge was retried and the first attempt already cleared the conflicts.
Related errors
- schema: verify fresh-bootstrap history: got %d commits, want
- table %s is not union-mergeable
- unexpected %s conflict row with no our_%s (safety check bypa
- clear %s conflict: %w
- dolt directory is required
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/a297fffa629b2349.
Report an issue: GitHub.