{"record":{"id":"edd1719c13d1e1d4","repo":"gastownhall/beads","slug":"db-getadaptiveidconfig-read-max-hash-length-w","errorCode":null,"errorMessage":"db: GetAdaptiveIDConfig: read max_hash_length: %w","messagePattern":"db: GetAdaptiveIDConfig: read max_hash_length: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/db/config.go","lineNumber":233,"sourceCode":"\n\tif probStr, err := r.GetConfig(ctx, \"max_collision_prob\"); err != nil {\n\t\treturn cfg, fmt.Errorf(\"db: GetAdaptiveIDConfig: read max_collision_prob: %w\", err)\n\t} else if probStr != \"\" {\n\t\tif prob, perr := strconv.ParseFloat(probStr, 64); perr == nil {\n\t\t\tcfg.MaxCollisionProbability = prob\n\t\t}\n\t}\n\n\tif minStr, err := r.GetConfig(ctx, \"min_hash_length\"); err != nil {\n\t\treturn cfg, fmt.Errorf(\"db: GetAdaptiveIDConfig: read min_hash_length: %w\", err)\n\t} else if minStr != \"\" {\n\t\tif v, perr := strconv.Atoi(minStr); perr == nil {\n\t\t\tcfg.MinLength = v\n\t\t}\n\t}\n\n\tif maxStr, err := r.GetConfig(ctx, \"max_hash_length\"); err != nil {\n\t\treturn cfg, fmt.Errorf(\"db: GetAdaptiveIDConfig: read max_hash_length: %w\", err)\n\t} else if maxStr != \"\" {\n\t\tif v, perr := strconv.Atoi(maxStr); perr == nil {\n\t\t\tcfg.MaxLength = v\n\t\t}\n\t}\n\n\treturn cfg, nil\n}\n\nfunc (r *configSQLRepositoryImpl) GetCustomStatuses(ctx context.Context) ([]types.CustomStatus, error) {\n\treturn issueops.ResolveCustomStatusesDetailedInTx(ctx, r.runner)\n}\n\nfunc (r *configSQLRepositoryImpl) ListAllStatusNames(ctx context.Context) ([]string, error) {\n\tbuiltins := []types.Status{\n\t\ttypes.StatusOpen, types.StatusInProgress, types.StatusBlocked,\n\t\ttypes.StatusDeferred, types.StatusClosed, types.StatusPinned, types.StatusHooked,\n\t}","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/db/config.go#L215-L251","documentation":"This error wraps a GetConfig(ctx, \"max_hash_length\") driver failure in GetAdaptiveIDConfig, the third sequential config read in that function. Like its siblings, it fires only on database I/O failures; an absent key leaves cfg.MaxLength at its default and unparsable values are ignored silently.","triggerScenarios":"Calling GetAdaptiveIDConfig when the SELECT for max_hash_length fails due to connection loss, context cancellation, or a server error on the config table.","commonSituations":"Connection resets during multi-read config loading, per-query deadlines expiring partway through GetAdaptiveIDConfig, Dolt server restarts.","solutions":["Unwrap the error to see the driver cause.","Reconnect and retry the config load.","Extend context timeouts so all three sequential reads fit within the deadline.","Check server logs for config-table query errors."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"cfg, err := store.GetAdaptiveIDConfig(ctx)\nif err != nil {\n    log.Printf(\"adaptive config unavailable (%v); applying defaults\", err)\n    cfg = domain.DefaultAdaptiveConfig()\n}","preventionTips":["Treat adaptive-ID tunables as optional; defaults are always safe.","Ensure one context covers all three config reads or split them with independent deadlines.","Alert on repeated config-read failures rather than masking them."],"tags":["database","config","adaptive-id"],"backgroundTag":"database-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}