gastownhall/beads · error
LoadCreateContext: read allowed_prefixes: %w
Error message
LoadCreateContext: read allowed_prefixes: %w
What it means
Wrapping error from ConfigUseCaseImpl.LoadCreateContext at internal/storage/domain/config.go:253. Raised when cfgRepo.GetAllowedPrefixes(ctx) fails while assembling the issue-creation context. The prefix itself was read successfully; the failure is specifically in enumerating the allowed-prefix configuration.
Source
Thrown at internal/storage/domain/config.go:253
}
return nil
}
func (u *configUseCaseImpl) SetLocalMetadata(ctx context.Context, key, value string) error {
if err := u.cfgRepo.SetLocalMetadata(ctx, key, value); err != nil {
return fmt.Errorf("SetLocalMetadata: %w", err)
}
return nil
}
func (u *configUseCaseImpl) LoadCreateContext(ctx context.Context) (CreateContext, error) {
prefix, err := u.cfgRepo.GetConfig(ctx, "issue_prefix")
if err != nil {
return CreateContext{}, fmt.Errorf("LoadCreateContext: read issue_prefix: %w", err)
}
allowed, err := u.cfgRepo.GetAllowedPrefixes(ctx)
if err != nil {
return CreateContext{}, fmt.Errorf("LoadCreateContext: read allowed_prefixes: %w", err)
}
customTypes, err := u.cfgRepo.GetCustomTypes(ctx)
if err != nil {
return CreateContext{}, fmt.Errorf("LoadCreateContext: read custom types: %w", err)
}
customStatuses, err := u.cfgRepo.GetCustomStatuses(ctx)
if err != nil {
return CreateContext{}, fmt.Errorf("LoadCreateContext: read custom statuses: %w", err)
}
infraTypes, err := u.GetInfraTypes(ctx)
if err != nil {
return CreateContext{}, fmt.Errorf("LoadCreateContext: read infra types: %w", err)
}
return CreateContext{
IssuePrefix: prefix,
AllowedPrefixes: allowed,
CustomTypes: customTypes,
CustomStatuses: customStatuses,View on GitHub (pinned to 71377f2769)
Solutions
- Unwrap the chain for the storage-level cause
- Check the allowed-prefixes config storage for corruption
- Re-establish the DB connection and retry
- If timeouts recur, reduce network latency or increase the context deadline
Defensive patterns
Strategy: retry
Validate before calling
// ensure allowed-prefix config is readable before create flows
if _, err := store.GetAllowedPrefixes(ctx); err != nil {
return fmt.Errorf("allowed prefixes unreadable: %w", err)
} Try / catch
cc, err := uc.LoadCreateContext(ctx)
if err != nil && strings.Contains(err.Error(), "read allowed_prefixes") {
// transient read failure — retry once with a fresh context
retryCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
cc, err = uc.LoadCreateContext(retryCtx)
}
return err Prevention
- Retry the whole LoadCreateContext (reads are non-transactional across steps)
- Keep network latency low between app and DB for multi-read sequences
- Watch for connection-pool exhaustion during long sessions
- Validate config tables after version upgrades
When it happens
Trigger: Calling LoadCreateContext when GetAllowedPrefixes fails — SQL error reading the allowed-prefixes config rows, connection dropped between the two reads, or cancelled context.
Common situations: Interrupted DB session mid-request; corrupted or partially migrated config tables; timeout while reading larger allowed-prefix lists over a slow connection.
Related errors
- LoadCreateContext: read issue_prefix: %w
- LoadCreateContext: read custom types: %w
- LoadCreateContext: read custom statuses: %w
- LoadCreateContext: read infra types: %w
- not found
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/f9f631cc01b270af.
Report an issue: GitHub.