{"record":{"id":"4e818092c7685a81","repo":"gastownhall/beads","slug":"load-custom-statuses-w","errorCode":null,"errorMessage":"load custom statuses: %w","messagePattern":"load custom statuses: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/workapi/list.go","lineNumber":143,"sourceCode":"\nfunc (p uowConfigSource) GetCustomStatuses(ctx context.Context) ([]types.CustomStatus, error) {\n\treturn p.uw.ConfigUseCase().GetCustomStatuses(ctx)\n}\nfunc (p uowConfigSource) GetCustomTypes(ctx context.Context) ([]string, error) {\n\treturn p.uw.ConfigUseCase().GetCustomTypes(ctx)\n}\nfunc (p uowConfigSource) GetInfraTypes(ctx context.Context) (map[string]bool, error) {\n\treturn p.uw.ConfigUseCase().GetInfraTypes(ctx)\n}\n\n// LoadListConfig materializes the list configuration from a ConfigSource,\n// falling back to the workspace YAML for custom types the store does not know.\nfunc LoadListConfig(ctx context.Context, src ConfigSource) (ListConfig, error) {\n\tvar cfg ListConfig\n\n\tstatuses, err := src.GetCustomStatuses(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load custom statuses: %w\", err)\n\t}\n\tcfg.CustomStatuses = statuses\n\n\tct, err := src.GetCustomTypes(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load custom types: %w\", err)\n\t}\n\tif len(ct) > 0 {\n\t\tcfg.CustomTypes = ct\n\t} else {\n\t\tcfg.CustomTypes = config.GetCustomTypesFromYAML()\n\t}\n\n\tinfraSet, err := src.GetInfraTypes(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load infra types: %w\", err)\n\t}\n\tif len(infraSet) > 0 {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/workapi/list.go#L125-L161","documentation":"This error is returned by LoadListConfig in internal/workapi/list.go when reading the workspace's custom statuses from the ConfigSource fails. LoadListConfig builds the ListConfig that BuildListFilter needs (custom statuses, custom types, infra types), and custom statuses are the first read; a failure here aborts the whole config load with the underlying cause wrapped. It is reached via LoadStoreListConfig (store handle) or LoadUOWListConfig (unit of work).","triggerScenarios":"Calling LoadStoreListConfig or LoadUOWListConfig (e.g. before `bd list`) where the store's GetCustomStatusesDetailed or the UOW's ConfigUseCase().GetCustomStatuses returns an error: the config/metadata table cannot be read (database unreachable, locked, corrupt, or the custom-statuses table missing after a failed migration).","commonSituations":"Running `bd list` with the Dolt server down or the database file locked; a version upgrade whose schema migration did not create the custom-statuses table; a corrupted workspace database; passing a store handle to a different/uninitialized workspace.","solutions":["Inspect the wrapped cause with errors.Is/errors.As to identify the underlying storage error","Verify the database is reachable and migrated (`bd doctor`); run pending migrations if any","Reconnect or reopen the store and retry","If the store cannot provide statuses, fall back to defaults or a nil store (LoadStoreListConfig already yields YAML custom types for a nil store)"],"exampleFix":"// before\ncfg, err := workapi.LoadStoreListConfig(ctx, store)\nif err != nil {\n    return err // hard fail: 'load custom statuses: ...'\n}\n// after\ncfg, err := workapi.LoadStoreListConfig(ctx, store)\nif err != nil {\n    log.Warnf(\"custom statuses unavailable, using defaults: %v\", err)\n    cfg = workapi.ListConfig{CustomTypes: config.GetCustomTypesFromYAML()}\n}","handlingStrategy":"fallback","validationCode":"if store == nil {\n    // LoadStoreListConfig handles nil by using YAML custom types; do the same up front\ncfg := workapi.ListConfig{CustomTypes: config.GetCustomTypesFromYAML()}\n    return cfg, nil\n}\nif err := store.Ping(ctx); err != nil {\n    return fmt.Errorf(\"store unreachable before list config load: %w\", err)\n}","typeGuard":"func isCustomStatusLoadError(err error) bool {\n    return err != nil && strings.HasPrefix(err.Error(), \"load custom statuses: \")\n}","tryCatchPattern":"cfg, err := workapi.LoadStoreListConfig(ctx, store)\nif err != nil {\n    if isCustomStatusLoadError(err) {\n        log.Warnf(\"falling back to default statuses: %v\", err)\n        cfg = workapi.ListConfig{CustomTypes: config.GetCustomTypesFromYAML()}\n    } else {\n        return err\n    }\n}","preventionTips":["Run `bd doctor` (and pending migrations) after version upgrades before issuing list commands","Check store connectivity before loading list config in long-running frontends","Keep only one writer process on the workspace database to avoid lock contention","Remember a nil store is valid and yields YAML-based custom types; use it as a graceful degraded mode"],"tags":["go","config","database","storage"],"backgroundTag":"config-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}