{"record":{"id":"324fa75fc444d184","repo":"gastownhall/beads","slug":"loadcreatecontext-read-custom-statuses-w","errorCode":null,"errorMessage":"LoadCreateContext: read custom statuses: %w","messagePattern":"LoadCreateContext: read custom statuses: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/domain/config.go","lineNumber":261,"sourceCode":"\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,\n\t\tInfraTypes:      infraTypes,\n\t}, nil\n}\n","sourceCodeStart":243,"sourceCodeEnd":275,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/domain/config.go#L243-L275","documentation":"Wrapping error from ConfigUseCaseImpl.LoadCreateContext at internal/storage/domain/config.go:261. Raised when cfgRepo.GetCustomStatuses(ctx) fails. This is the fourth read in LoadCreateContext (after prefix, allowed prefixes, custom types), so earlier reads succeeded and the failure is specific to loading custom workflow statuses.","triggerScenarios":"Calling LoadCreateContext when GetCustomStatuses fails — storage query error, dropped connection partway through the multi-read sequence, or context cancellation.","commonSituations":"Long-running LoadCreateContext hitting a context deadline on slow storage; corrupted custom-status rows; DB restarted between reads.","solutions":["Unwrap the error chain to the storage cause","Verify custom-statuses storage integrity","Increase the context deadline if timeouts are the cause","Retry LoadCreateContext once storage is stable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check custom statuses readability with an adequate deadline\nctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\ndefer cancel()\nif _, err := store.GetCustomStatuses(ctx); err != nil {\n\treturn fmt.Errorf(\"custom statuses unreadable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cc, err := uc.LoadCreateContext(ctx)\nif err != nil {\n\tif strings.Contains(err.Error(), \"read custom statuses\") && errors.Is(err, context.DeadlineExceeded) {\n\t\t// deadline hit late in the multi-read sequence; retry with longer budget\n\t\tlongCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n\t\tdefer cancel()\n\t\tcc, err = uc.LoadCreateContext(longCtx)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n}","preventionTips":["Budget enough context time for all five sequential reads","Check custom-status rows for corruption after crashes","Monitor DB restarts during long read sequences","Surface the wrapped cause to users, not just the wrapper message"],"tags":["config","custom-statuses","storage","error-wrapping"],"backgroundTag":"config-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}