{"record":{"id":"67a558f173fe90be","repo":"gastownhall/beads","slug":"resolving-s-w-67a558","errorCode":null,"errorMessage":"resolving %s: %w","messagePattern":"resolving (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mutate_proxied_server.go","lineNumber":28,"sourceCode":"\t\"github.com/steveyegge/beads/internal/types\"\n\t\"github.com/steveyegge/beads/internal/ui\"\n\t\"github.com/steveyegge/beads/internal/validation\"\n\t\"github.com/steveyegge/beads/internal/workapi\"\n\t\"github.com/steveyegge/beads/issueops\"\n)\n\nfunc proxiedMutateIssue(ctx context.Context, id, commitMsg string, mutate func(ctx context.Context, uw uow.UnitOfWork, issue *types.Issue, isWisp bool) error) (*types.Issue, error) {\n\tif uowProvider == nil {\n\t\treturn nil, fmt.Errorf(\"proxied-server UOW provider not initialized\")\n\t}\n\tvar updated *types.Issue\n\terr := uow.RunTx(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {\n\t\tissue, isWisp, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(uw), id)\n\t\tif errors.Is(rerr, storage.ErrNotFound) {\n\t\t\treturn \"\", fmt.Errorf(\"issue %s not found\", id)\n\t\t}\n\t\tif rerr != nil {\n\t\t\treturn \"\", fmt.Errorf(\"resolving %s: %w\", id, rerr)\n\t\t}\n\t\tif err := validateIssueUpdatable(id, issue); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif err := mutate(ctx, uw, issue, isWisp); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif isWisp {\n\t\t\tupdated, _ = uw.IssueUseCase().GetWisp(ctx, issue.ID)\n\t\t} else {\n\t\t\tupdated, _ = uw.IssueUseCase().GetIssue(ctx, issue.ID)\n\t\t}\n\t\treturn commitMsg, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommandDidWrite.Store(true)","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mutate_proxied_server.go#L10-L46","documentation":"When GetIssueOrWisp fails for any reason other than ErrNotFound (driver error, transaction failure, deserialization problem), the error is wrapped as 'resolving <id>: %w'. It signals the mutation aborted while reading the issue, not that the issue is absent.","triggerScenarios":"Any proxied mutation where the storage read inside uow.RunTx errors — database connection failure, driver-level error, corrupt row, or context canceled during the read.","commonSituations":"Dolt server unreachable or restarted mid-command; lock contention/timeout on the database; disk or corruption errors; context deadline exceeded on slow storage.","solutions":["Read the wrapped cause after 'resolving <id>:' to identify the driver error and address it (connectivity, locks, disk).","Retry the command once storage is healthy; transient lock/timeout errors usually clear.","Restart the local Dolt/store process if the connection is wedged.","If corruption is indicated, restore from backup or re-sync (`bd dolt pull`)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-check storage reachability before mutating\nif err := store.HealthCheck(ctx); err != nil {\n    return fmt.Errorf(\"storage unhealthy, aborting mutation of %s: %w\", id, err)\n}","typeGuard":null,"tryCatchPattern":"_, err := proxiedMutateIssue(ctx, id, msg, mutate)\nif err != nil && strings.Contains(err.Error(), \"resolving \"+id) {\n    // transient storage error: wait/backoff and retry once\n    time.Sleep(time.Second)\n    return proxiedMutateIssue(ctx, id, msg, mutate)\n}","preventionTips":["Keep the Dolt server process healthy and restart it if wedged","Use generous context timeouts for storage-heavy commands","Investigate the wrapped driver error instead of blindly retrying","Monitor disk space and database locks"],"tags":["go","storage","transaction"],"backgroundTag":"storage-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}