{"record":{"id":"f27db57eadd81f10","repo":"gastownhall/beads","slug":"conflict-resolution-failed-for-s-w","errorCode":null,"errorMessage":"conflict resolution failed for %s: %w","messagePattern":"conflict resolution failed for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/federation.go","lineNumber":394,"sourceCode":"\tif err != nil {\n\t\tresult.Error = fmt.Errorf(\"merge failed: %w\", err)\n\t\treturn result, result.Error\n\t}\n\n\t// Step 4: Handle conflicts if any\n\tif len(conflicts) > 0 {\n\t\tresult.Conflicts = conflicts\n\n\t\tif strategy == \"\" {\n\t\t\t// No strategy specified, leave conflicts for manual resolution\n\t\t\tresult.Error = fmt.Errorf(\"merge conflicts require resolution (use --strategy ours|theirs)\")\n\t\t\treturn result, result.Error\n\t\t}\n\n\t\t// Auto-resolve using strategy\n\t\tfor _, c := range conflicts {\n\t\t\tif err := s.ResolveConflicts(ctx, c.Field, strategy); err != nil {\n\t\t\t\tresult.Error = fmt.Errorf(\"conflict resolution failed for %s: %w\", c.Field, err)\n\t\t\t\treturn result, result.Error\n\t\t\t}\n\t\t}\n\t\tresult.ConflictsResolved = true\n\n\t\t// Commit the resolution INCLUDING config: the operator chose this\n\t\t// strategy, and plain Commit excludes config (GH#2455). A config-only\n\t\t// conflict — routine now that kv.memory.* memories sync through config —\n\t\t// would otherwise resolve but never commit, leaving the merge\n\t\t// unconcluded and re-wedging the next sync.\n\t\tif err := s.CommitMergeResolution(ctx, fmt.Sprintf(\"Resolve conflicts from %s using %s strategy\", peer, strategy)); err != nil {\n\t\t\tresult.Error = fmt.Errorf(\"failed to commit conflict resolution: %w\", err)\n\t\t\treturn result, result.Error\n\t\t}\n\n\t\t// bd-578h9.11: the conflicted merge skipped the automatic is_blocked\n\t\t// recompute (unresolved rows would have fed it garbage); now that the\n\t\t// resolution is committed, cover the whole merge+resolution window.","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/federation.go#L376-L412","documentation":"Sync attempted to auto-resolve each conflict via ResolveConflicts(ctx, c.Field, strategy) and one of those calls failed. The error names the offending field (%s) and wraps the cause. Resolution is per-field, so partial resolution may have occurred for earlier fields.","triggerScenarios":"store.Sync(ctx, peer, \"ours\"|\"theirs\", opts) where a conflicted merge exists and ResolveConflicts errors on some field — e.g. the field no longer exists, SQL failure writing the resolution, or strategy value invalid at the storage layer.","commonSituations":"Schema drift between replicas so a conflicted field is unknown locally; DB lock/timeout mid-resolution; strategy string corrupted before reaching the store; conflict rows already cleaned up by a concurrent process.","solutions":["Note the named field and inspect `dolt conflicts` / result.Conflicts for its state","Re-run the sync with the same strategy — resolution is re-attempted per remaining conflict","Check for concurrent processes touching dolt_conflicts and serialize syncs","Verify the strategy is exactly \"ours\" or \"theirs\" and the local schema matches the peer's","If schema drift is the cause, pull the peer's schema changes first (fetch+merge on a clean tree)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if strategy != \"ours\" && strategy != \"theirs\" {\n    return fmt.Errorf(\"strategy must be ours|theirs, got %q\", strategy)\n}","typeGuard":null,"tryCatchPattern":"result, err := store.Sync(ctx, peer, strategy, opts)\nif err != nil && strings.Contains(err.Error(), \"conflict resolution failed for\") {\n    field := extractField(err) // parse %s from message or read result.Conflicts\n    log.Printf(\"resolution failed on field %s; retrying sync\", field)\n    retrySync(strategy)\n}","preventionTips":["Keep both replicas on the same schema version before syncing","Serialize syncs so conflict rows aren't mutated concurrently","Validate strategy strings at the CLI boundary"],"tags":["dolt","federation","sync","conflict","resolution"],"backgroundTag":"merge-conflicts-unresolved","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}