{"record":{"id":"2fa47b0cf76c92b3","repo":"gastownhall/beads","slug":"db-getallconfig-w","errorCode":null,"errorMessage":"db: GetAllConfig: %w","messagePattern":"db: GetAllConfig: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/db/config.go","lineNumber":112,"sourceCode":"\t// The caller supplies a transactional runner, so the row and its projection\n\t// commit together or neither does.\n\tif _, err := issueops.SyncConfigTables(ctx, r.runner, key, value); err != nil {\n\t\treturn fmt.Errorf(\"db: SetConfig %s: %w\", key, err)\n\t}\n\treturn nil\n}\n\nfunc (r *configSQLRepositoryImpl) DeleteConfig(ctx context.Context, key string) error {\n\tif _, err := r.runner.ExecContext(ctx, \"DELETE FROM config WHERE `key` = ?\", key); err != nil {\n\t\treturn fmt.Errorf(\"db: DeleteConfig %s: %w\", key, err)\n\t}\n\treturn nil\n}\n\nfunc (r *configSQLRepositoryImpl) GetAllConfig(ctx context.Context) (map[string]string, error) {\n\trows, err := r.runner.QueryContext(ctx, \"SELECT `key`, value FROM config\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"db: GetAllConfig: %w\", err)\n\t}\n\tdefer rows.Close()\n\tout := make(map[string]string)\n\tfor rows.Next() {\n\t\tvar k, v string\n\t\tif err := rows.Scan(&k, &v); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"db: GetAllConfig: scan: %w\", err)\n\t\t}\n\t\tout[k] = v\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"db: GetAllConfig: read: %w\", err)\n\t}\n\treturn out, nil\n}\n\nfunc (r *configSQLRepositoryImpl) GetCustomTypes(ctx context.Context) ([]string, error) {\n\tfromTable, err := r.readCustomTypesTable(ctx)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/db/config.go#L94-L130","documentation":"This error wraps failure of the query that enumerates all config rows in GetAllConfig. It fires when the SELECT `key`, value FROM config statement itself fails, before any row iteration begins. Row-scan and iteration errors are reported by the separate scan and read wrappers.","triggerScenarios":"Calling GetAllConfig(ctx) when QueryContext fails: config table missing from the schema, database locked or unreachable, connection dropped, or context canceled before the query starts returning.","commonSituations":"Opening a repo with an old schema lacking the config table; `bd config list` against a locked or corrupted database; context deadline exceeded on a large/slow Dolt database.","solutions":["Check the wrapped cause; run schema migration if the config table is missing","Clear competing database locks and retry","Increase the operation timeout if the context deadline was exceeded","Verify database file integrity and disk health","Restore from backup if the database is corrupted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if err := ensureSchemaMigrated(ctx); err != nil {\n\treturn fmt.Errorf(\"config table unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"all, err := repo.GetAllConfig(ctx)\nif err != nil {\n\tif errors.Is(err, context.DeadlineExceeded) {\n\t\treturn nil, fmt.Errorf(\"config listing timed out; increase timeout\")\n\t}\n\treturn nil, fmt.Errorf(\"listing config: %w\", err)\n}","preventionTips":["Use an adequate context timeout when enumerating config on large databases","Run migrations after bd upgrades","Verify database health with `bd doctor` if enumeration fails repeatedly","Avoid holding the database open across long operations that may cancel the context"],"tags":["database","storage","dolt","query-failed"],"backgroundTag":"sql-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}