{"record":{"id":"ad5fdbb7f59205c4","repo":"gastownhall/beads","slug":"failed-to-resolve-config-conflicts-w","errorCode":null,"errorMessage":"failed to resolve config conflicts: %w","messagePattern":"failed to resolve config conflicts: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/versioncontrolops/mergesettle.go","lineNumber":544,"sourceCode":"\t\t\t// Row-wise: keep whichever side recorded a content hash, so the\n\t\t\t// table-level --ours/--theirs choice can never drop one.\n\t\t\tif err := resolveSchemaMigrationsVintageConflicts(ctx, db); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\tcase \"config\":\n\t\t\t// --theirs makes this clone's local kv.memory.* edit lose to the\n\t\t\t// remote value (the same convergent trade-off metadata makes). That\n\t\t\t// supersession is otherwise undiagnosable, so name the resolved keys\n\t\t\t// first. Best-effort: a diagnostics query failure must not abort an\n\t\t\t// otherwise-correct resolution.\n\t\t\tif keys, kerr := resolvedConfigConflictKeys(ctx, db); kerr == nil && len(keys) > 0 {\n\t\t\t\tfmt.Fprintf(os.Stderr,\n\t\t\t\t\t\"Notice: auto-resolved %d memory config conflict(s) with the remote value (--theirs); \"+\n\t\t\t\t\t\t\"local edits to %s were superseded\\n\",\n\t\t\t\t\tlen(keys), strings.Join(keys, \", \"))\n\t\t\t}\n\t\t\tif _, err := db.ExecContext(ctx, \"CALL DOLT_CONFLICTS_RESOLVE('--theirs', 'config')\"); err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"failed to resolve config conflicts: %w\", err)\n\t\t\t}\n\t\tcase \"issues\":\n\t\t\t// Field-level three-way merge, not a table-level --ours/--theirs:\n\t\t\t// a cell only one side changed keeps that side's value and only a\n\t\t\t// genuinely contested cell falls to LWW (automerge.go).\n\t\t\tif err := resolveIssuesFieldMerge(ctx, db, issuesPlan); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\tcase \"labels\", \"comments\", \"events\":\n\t\t\tif err := resolveUnionConflicts(ctx, db, table, unionPlans[table]); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\tdefault:\n\t\t\t//nolint:gosec // G201: table is one of the hardcoded constants above.\n\t\t\tif _, err := db.ExecContext(ctx, \"CALL DOLT_CONFLICTS_RESOLVE('--theirs', '\"+table+\"')\"); err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"failed to resolve %s conflicts: %w\", table, err)\n\t\t\t}\n\t\t}","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/versioncontrolops/mergesettle.go#L526-L562","documentation":"For conflicts in the `config` table, the auto-resolver takes the remote value (--theirs) and issues CALL DOLT_CONFLICTS_RESOLVE('--theirs', 'config'). If that call errors, the auto-resolve aborts with this wrapped error and the caller (SettleMerge) falls back or fails.","triggerScenarios":"Config-table conflicts exist after a merge, but DOLT_CONFLICTS_RESOLVE('--theirs','config') is rejected — unsupported resolution mode, table name mismatch, or no active merge in the session.","commonSituations":"Both local and remote edited a config key (e.g. remote URL, default branch); local edits get superseded by design but the resolve call itself fails on older Dolt or a mid-merge session mismatch.","solutions":["Check the inner Dolt error for the precise reason","Run `CALL DOLT_CONFLICTS_RESOLVE('--theirs', 'config')` manually to reproduce","Upgrade Dolt if the call mode is unsupported","If no merge is active, re-run the merge so conflicts exist before settling"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var n int\n_ = db.QueryRowContext(ctx, \"SELECT COUNT(*) FROM dolt_conflicts WHERE \\\"table\\\" = 'config'\").Scan(&n)\n// n > 0 means the --theirs resolve path will be attempted\n","typeGuard":null,"tryCatchPattern":"ok, err := TryAutoResolveMergeConflicts(ctx, db)\nif err != nil && strings.Contains(err.Error(), \"config conflicts\") {\n    // manual fallback:\n    _, _ = db.ExecContext(ctx, \"CALL DOLT_CONFLICTS_RESOLVE('--theirs', 'config')\")\n    // or resolve per-key manually, preserving local overrides deliberately\n}","preventionTips":["Minimize concurrent local edits to config keys that remotes also change","Pull/rebase config changes before pushing to reduce conflicts","Keep Dolt version supporting DOLT_CONFLICTS_RESOLVE('--theirs', ...)"],"tags":["dolt","merge","config","conflict-resolution"],"backgroundTag":"dolt-conflict-resolution-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}