{"record":{"id":"f9f631cc01b270af","repo":"gastownhall/beads","slug":"loadcreatecontext-read-allowed-prefixes-w","errorCode":null,"errorMessage":"LoadCreateContext: read allowed_prefixes: %w","messagePattern":"LoadCreateContext: read allowed_prefixes: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/config.go","lineNumber":253,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (u *configUseCaseImpl) SetLocalMetadata(ctx context.Context, key, value string) error {\n\tif err := u.cfgRepo.SetLocalMetadata(ctx, key, value); err != nil {\n\t\treturn fmt.Errorf(\"SetLocalMetadata: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (u *configUseCaseImpl) LoadCreateContext(ctx context.Context) (CreateContext, error) {\n\tprefix, err := u.cfgRepo.GetConfig(ctx, \"issue_prefix\")\n\tif err != nil {\n\t\treturn CreateContext{}, fmt.Errorf(\"LoadCreateContext: read issue_prefix: %w\", err)\n\t}\n\tallowed, err := u.cfgRepo.GetAllowedPrefixes(ctx)\n\tif err != nil {\n\t\treturn CreateContext{}, fmt.Errorf(\"LoadCreateContext: read allowed_prefixes: %w\", err)\n\t}\n\tcustomTypes, err := u.cfgRepo.GetCustomTypes(ctx)\n\tif err != nil {\n\t\treturn CreateContext{}, fmt.Errorf(\"LoadCreateContext: read custom types: %w\", err)\n\t}\n\tcustomStatuses, err := u.cfgRepo.GetCustomStatuses(ctx)\n\tif err != nil {\n\t\treturn CreateContext{}, fmt.Errorf(\"LoadCreateContext: read custom statuses: %w\", err)\n\t}\n\tinfraTypes, err := u.GetInfraTypes(ctx)\n\tif err != nil {\n\t\treturn CreateContext{}, fmt.Errorf(\"LoadCreateContext: read infra types: %w\", err)\n\t}\n\treturn CreateContext{\n\t\tIssuePrefix:     prefix,\n\t\tAllowedPrefixes: allowed,\n\t\tCustomTypes:     customTypes,\n\t\tCustomStatuses:  customStatuses,","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/config.go#L235-L271","documentation":"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.","triggerScenarios":"Calling LoadCreateContext when GetAllowedPrefixes fails — SQL error reading the allowed-prefixes config rows, connection dropped between the two reads, or cancelled context.","commonSituations":"Interrupted DB session mid-request; corrupted or partially migrated config tables; timeout while reading larger allowed-prefix lists over a slow connection.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure allowed-prefix config is readable before create flows\nif _, err := store.GetAllowedPrefixes(ctx); err != nil {\n\treturn fmt.Errorf(\"allowed prefixes unreadable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cc, err := uc.LoadCreateContext(ctx)\nif err != nil && strings.Contains(err.Error(), \"read allowed_prefixes\") {\n\t// transient read failure — retry once with a fresh context\n\tretryCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tcc, err = uc.LoadCreateContext(retryCtx)\n}\nreturn err","preventionTips":["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"],"tags":["config","storage","prefixes","error-wrapping"],"backgroundTag":"config-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}