{"record":{"id":"ea156dc1f363524d","repo":"gastownhall/beads","slug":"reading-dolt-ignore-w","errorCode":null,"errorMessage":"reading dolt_ignore: %w","messagePattern":"reading dolt_ignore: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/schema/converged.go","lineNumber":214,"sourceCode":"// cannot get the full be-bv7x probe-before-act treatment at table granularity.\n// What it has instead: selectTargetDatabase has already proved this session is\n// on the target database (by reading DATABASE(), or by probing\n// information_schema.schemata and selecting it), Dolt materializes dolt_ignore\n// on every real database (live-verified), the name is stated explicitly\n// whenever one was quoted for us rather than re-derived here, and\n// IsTableNotExist below fails closed onto the locked path should that\n// materialization assumption break.\nfunc doltIgnoreSeeded(ctx context.Context, db DBConn, qualifier string, mainVersionAtLeast int) (bool, error) {\n\ttable := \"dolt_ignore\"\n\tif qualifier != \"\" {\n\t\ttable = qualifier + \".dolt_ignore\"\n\t}\n\trows, err := db.QueryContext(ctx, \"SELECT pattern FROM \"+table)\n\tif err != nil {\n\t\tif dberrors.IsTableNotExist(err) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"reading dolt_ignore: %w\", err)\n\t}\n\tdefer rows.Close()\n\n\tpresent := make(map[string]struct{})\n\tfor rows.Next() {\n\t\tvar pattern string\n\t\tif err := rows.Scan(&pattern); err != nil {\n\t\t\treturn false, fmt.Errorf(\"reading dolt_ignore: %w\", err)\n\t\t}\n\t\tpresent[pattern] = struct{}{}\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn false, fmt.Errorf(\"reading dolt_ignore: %w\", err)\n\t}\n\n\tfor _, pattern := range doltIgnorePatterns {\n\t\tif _, ok := present[pattern]; !ok {\n\t\t\treturn false, nil","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/schema/converged.go#L196-L232","documentation":"doltIgnoreSeeded reads the dolt_ignore system table to verify all canonical ignore patterns are seeded before taking the lock-free fast path. This error wraps a failure of the initial SELECT pattern FROM [qualifier.]dolt_ignore query — but only for errors that are NOT table-does-not-exist (that case cleanly returns false). It signals an unexpected read failure against a table that Dolt should materialize on every real database.","triggerScenarios":"SELECT pattern FROM dolt_ignore fails with a non-TableNotExist error: connection failure mid-open, permission denial on dolt_ignore, a misspelled database qualifier, a server version that errors on dolt_ignore, or context cancellation.","commonSituations":"Running against a Dolt server version where dolt_ignore behaves unexpectedly; grants restricting system-table reads; the pooled connection dying between the earlier probes and this query; typo'd or stale database qualifier from a custom selector.","solutions":["Retry — alreadyConverged fails closed, so bd will just take the normal locked migration path; the error may be transient","Inspect the wrapped error for permission (denied) vs connection (EOF/refused) causes and fix accordingly","Upgrade the Dolt server if dolt_ignore errors on your version","Verify the database qualifier is correct if a custom DatabaseSelector is in play"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// confirm the qualifier database name before the read\nvar n int\n_ = db.QueryRow(\"SELECT COUNT(*) FROM information_schema.schemata WHERE schema_name = ?\", dbname).Scan(&n)\nif n == 0 { return } // wrong qualifier would error on dolt_ignore read","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"reading dolt_ignore\") {\n    // fall back to the locked migration path, which re-seeds dolt_ignore\n    return migrateUpLocked(ctx, db)\n}","preventionTips":["Use stock DatabaseSelector so the qualifier is always correct","Upgrade Dolt server to a version with stable dolt_ignore support","Do not hand-edit dolt_ignore rows"],"tags":["go","dolt","dolt-ignore","system-table"],"backgroundTag":"dolt-ignore-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}