{"record":{"id":"408f1fd05eb11190","repo":"gastownhall/beads","slug":"load-custom-types-w","errorCode":null,"errorMessage":"load custom types: %w","messagePattern":"load custom types: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/workapi/list.go","lineNumber":149,"sourceCode":"}\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 {\n\t\tcfg.InfraSet = infraSet\n\t}\n\n\treturn cfg, nil\n}\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/workapi/list.go#L131-L167","documentation":"This error is returned by LoadListConfig in internal/workapi/list.go when reading the workspace's custom issue types from the ConfigSource fails, after custom statuses were loaded successfully. It wraps the underlying ConfigUseCase/store error and aborts the ListConfig load. Unlike the failure path, an empty (but successful) custom-types result is fine: the loader then falls back to config.GetCustomTypesFromYAML.","triggerScenarios":"Calling LoadStoreListConfig or LoadUOWListConfig where GetCustomTypes on the store or ConfigUseCase().GetCustomTypes returns an error: the metadata query against the config storage fails (unreachable database, locked/corrupt file, missing table after a partial migration).","commonSituations":"Running `bd list` against a Dolt database that is down, locked by another process, or half-migrated; a corrupted workspace where the statuses read succeeds but the types read fails; an in-flight schema change breaking one config query but not the other.","solutions":["Inspect the wrapped cause with errors.Is/errors.As to identify the underlying storage error","Verify database health and schema completeness (`bd doctor`); complete pending migrations","Reconnect or reopen the store and retry the list operation","As a stopgap, fall back to config.GetCustomTypesFromYAML() to build a degraded ListConfig"],"exampleFix":"// before\ncfg, err := workapi.LoadUOWListConfig(ctx, uw)\nif err != nil {\n    return err // aborts: 'load custom types: ...'\n}\n// after\ncfg, err := workapi.LoadUOWListConfig(ctx, uw)\nif err != nil {\n    if strings.Contains(err.Error(), \"load custom types\") {\n        log.Warnf(\"custom types unavailable, falling back to YAML: %v\", err)\n        cfg.CustomTypes = config.GetCustomTypesFromYAML()\n    } else {\n        return err\n    }\n}","handlingStrategy":"fallback","validationCode":"if err := ctx.Err(); err != nil {\n    return fmt.Errorf(\"context already done: %w\", err)\n}\nif err := store.Ping(ctx); err != nil {\n    return fmt.Errorf(\"store unreachable before list config load: %w\", err)\n}","typeGuard":"func isCustomTypesLoadError(err error) bool {\n    return err != nil && strings.HasPrefix(err.Error(), \"load custom types: \")\n}","tryCatchPattern":"cfg, err := workapi.LoadUOWListConfig(ctx, uw)\nif err != nil {\n    if isCustomTypesLoadError(err) {\n        log.Warnf(\"custom types unavailable from store, using workspace YAML: %v\", err)\n        cfg.CustomTypes = config.GetCustomTypesFromYAML()\n    } else {\n        return err\n    }\n}","preventionTips":["Ensure schema migrations complete fully so statuses load but types do not fail mid-config","Call config.GetCustomTypesFromYAML() as the documented fallback when the store returns no types or errors","Verify database health with `bd doctor` before batch list operations","Distinguish config-load failures from filter failures by matching the 'load custom types:' prefix or wrapping your own sentinel"],"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"}