{"record":{"id":"cb1a58ed184782b7","repo":"gastownhall/beads","slug":"check-merge-conflicts-for-branch-s-w","errorCode":null,"errorMessage":"check merge conflicts for branch %s: %w","messagePattern":"check merge conflicts for branch (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/versioncontrolops/mergesettle.go","lineNumber":290,"sourceCode":"\t\treturn nil, fmt.Errorf(\"set dolt_force_transaction_commit: %w\", err)\n\t}\n\n\t_, mergeErr := db.ExecContext(ctx, \"CALL DOLT_MERGE('--author', ?, ?)\", author, ref)\n\tif mergeErr != nil && strings.Contains(mergeErr.Error(), \"up to date\") {\n\t\tmergeErr = nil\n\t}\n\n\t// Check for conflicts regardless of whether the merge statement itself\n\t// errored: with the flags above set, a genuinely conflicted merge lands in\n\t// the working set instead of erroring, but older Dolt behavior (or a\n\t// conflict class the flags don't cover) may still report both.\n\tconflicts, cErr := GetConflicts(ctx, db)\n\tif cErr != nil {\n\t\tabortMerge(ctx, db, preMergeClean)\n\t\tif mergeErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"merge branch %s: %w\", ref, mergeErr)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"check merge conflicts for branch %s: %w\", ref, cErr)\n\t}\n\n\tif len(conflicts) == 0 {\n\t\tif mergeErr != nil {\n\t\t\t// Not a conflict: some other merge failure (unknown branch, dirty\n\t\t\t// working set, ...). Nothing to resolve — surface it as-is.\n\t\t\tabortMerge(ctx, db, preMergeClean)\n\t\t\treturn nil, fmt.Errorf(\"merge branch %s: %w\", ref, mergeErr)\n\t\t}\n\t\treturn nil, nil\n\t}\n\n\tdirtyTables := make(map[string]bool, len(conflicts))\n\tfor _, c := range conflicts {\n\t\ttable := c.Field\n\t\tif table == \"\" {\n\t\t\ttable = \"issues\"\n\t\t}","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/versioncontrolops/mergesettle.go#L272-L308","documentation":"This wraps a failure of GetConflicts after a merge attempt: the library could not even read dolt_conflicts to classify the merge outcome. Because conflict detection failed, MergeWithStrategy aborts the merge and returns this error rather than guessing.","triggerScenarios":"CALL DOLT_MERGE returns (possibly with conflicts pending) and the subsequent query against dolt_conflicts fails — e.g. table missing, server error, connection dropped mid-merge.","commonSituations":"Older Dolt server without dolt_conflicts support; connection reset during a long merge; permissions preventing reads of the dolt_conflicts system table.","solutions":["Verify `SELECT * FROM dolt_conflicts` works on the same connection; if not, upgrade Dolt","Check server logs / connection health — retry after reconnecting if the connection dropped","Confirm the DB user can read dolt_conflicts system tables","The merge was aborted, so the repo is at pre-merge state; fix the root cause and re-run the merge"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := db.QueryContext(ctx, \"SELECT 1 FROM dolt_conflicts LIMIT 1\"); err != nil {\n    // conflict introspection unavailable; upgrade Dolt before merging\n}","typeGuard":null,"tryCatchPattern":"conflicts, err := MergeWithStrategy(ctx, db, ref, strategy, author)\nif err != nil {\n    if isTransient(err) { // connection reset, deadline\n        time.Sleep(backoff)\n        conflicts, err = MergeWithStrategy(ctx, db, ref, strategy, author)\n    }\n}","preventionTips":["Use generous context timeouts for merge+settle operations","Verify dolt_conflicts accessibility at startup","Keep Dolt server and client versions aligned"],"tags":["dolt","merge","conflicts"],"backgroundTag":"dolt-conflict-table-unavailable","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}