gastownhall/beads · error

load custom types: %w

Error message

load custom types: %w

What it means

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.

Source

Thrown at internal/workapi/list.go:149

}
func (p uowConfigSource) GetInfraTypes(ctx context.Context) (map[string]bool, error) {
	return p.uw.ConfigUseCase().GetInfraTypes(ctx)
}

// LoadListConfig materializes the list configuration from a ConfigSource,
// falling back to the workspace YAML for custom types the store does not know.
func LoadListConfig(ctx context.Context, src ConfigSource) (ListConfig, error) {
	var cfg ListConfig

	statuses, err := src.GetCustomStatuses(ctx)
	if err != nil {
		return cfg, fmt.Errorf("load custom statuses: %w", err)
	}
	cfg.CustomStatuses = statuses

	ct, err := src.GetCustomTypes(ctx)
	if err != nil {
		return cfg, fmt.Errorf("load custom types: %w", err)
	}
	if len(ct) > 0 {
		cfg.CustomTypes = ct
	} else {
		cfg.CustomTypes = config.GetCustomTypesFromYAML()
	}

	infraSet, err := src.GetInfraTypes(ctx)
	if err != nil {
		return cfg, fmt.Errorf("load infra types: %w", err)
	}
	if len(infraSet) > 0 {
		cfg.InfraSet = infraSet
	}

	return cfg, nil
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped cause with errors.Is/errors.As to identify the underlying storage error
  2. Verify database health and schema completeness (`bd doctor`); complete pending migrations
  3. Reconnect or reopen the store and retry the list operation
  4. As a stopgap, fall back to config.GetCustomTypesFromYAML() to build a degraded ListConfig

Example fix

// before
cfg, err := workapi.LoadUOWListConfig(ctx, uw)
if err != nil {
    return err // aborts: 'load custom types: ...'
}
// after
cfg, err := workapi.LoadUOWListConfig(ctx, uw)
if err != nil {
    if strings.Contains(err.Error(), "load custom types") {
        log.Warnf("custom types unavailable, falling back to YAML: %v", err)
        cfg.CustomTypes = config.GetCustomTypesFromYAML()
    } else {
        return err
    }
}
Defensive patterns

Strategy: fallback

Validate before calling

if err := ctx.Err(); err != nil {
    return fmt.Errorf("context already done: %w", err)
}
if err := store.Ping(ctx); err != nil {
    return fmt.Errorf("store unreachable before list config load: %w", err)
}

Type guard

func isCustomTypesLoadError(err error) bool {
    return err != nil && strings.HasPrefix(err.Error(), "load custom types: ")
}

Try / catch

cfg, err := workapi.LoadUOWListConfig(ctx, uw)
if err != nil {
    if isCustomTypesLoadError(err) {
        log.Warnf("custom types unavailable from store, using workspace YAML: %v", err)
        cfg.CustomTypes = config.GetCustomTypesFromYAML()
    } else {
        return err
    }
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/408f1fd05eb11190. Report an issue: GitHub.