{"record":{"id":"f1bf08ba8f1f52a2","repo":"gastownhall/beads","slug":"read-comments-for-s-w","errorCode":null,"errorMessage":"read comments for %s: %w","messagePattern":"read comments for (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_personal.go","lineNumber":227,"sourceCode":"\tfor _, label := range labels {\n\t\tif err := dst.AddLabel(ctx, issue.ID, label, actor); err != nil {\n\t\t\treturn fmt.Errorf(\"copy label %q for %s: %w\", label, issue.ID, err)\n\t\t}\n\t}\n\n\tdeps, err := src.GetDependencyRecords(ctx, issue.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read dependencies for %s: %w\", issue.ID, err)\n\t}\n\tfor _, dep := range deps {\n\t\tif err := dst.AddDependency(ctx, dep, actor); err != nil {\n\t\t\treturn fmt.Errorf(\"copy dependency %s→%s: %w\", dep.IssueID, dep.DependsOnID, err)\n\t\t}\n\t}\n\n\tcomments, err := src.GetIssueComments(ctx, issue.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read comments for %s: %w\", issue.ID, err)\n\t}\n\tfor _, c := range comments {\n\t\t// ImportIssueComment writes a structured comment row preserving the\n\t\t// original author and created_at. AddComment would instead record an\n\t\t// event-style entry that GetIssueComments never returns, silently\n\t\t// dropping the comment from the migrated issue (maphew review, be-e2nb).\n\t\tif _, err := dst.ImportIssueComment(ctx, issue.ID, c.Author, c.Text, c.CreatedAt); err != nil {\n\t\t\treturn fmt.Errorf(\"copy comment for %s: %w\", issue.ID, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc pluralIssue(n int) string {\n\tif n == 1 {\n\t\treturn \"issue\"\n\t}","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_personal.go#L209-L245","documentation":"copyIssueRelations reads the issue's comments with src.GetIssueComments; a read failure aborts the migration with this wrapped error so no comment is silently lost.","triggerScenarios":"src.GetIssueComments(ctx, issue.ID) returns an error during migration — source driver error, corrupted comment rows, or DB lock.","commonSituations":"Source database locked by another process, or comment rows damaged by an earlier failed write during a previous migration attempt.","solutions":["Read the wrapped inner error for the driver-level cause.","Verify source DB health (bd doctor) and that no other process holds the lock.","Fix access and re-run migration; the fatal-on-error contract keeps the source intact."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight comment read\nif _, err := src.GetIssueComments(ctx, issue.ID); err != nil {\n    return fmt.Errorf(\"pre-flight comments %s: %w\", issue.ID, err)\n}","typeGuard":null,"tryCatchPattern":"if err := copyIssueRelations(ctx, src, dst, issue, actor); err != nil {\n    // err wraps: read comments for <id>: <driver err>\n    return err // abort; do not delete source\n}","preventionTips":["Release source DB locks (close other bd processes) before migrating.","Check source comment-table integrity with bd doctor.","Retry is safe: source is never deleted on failure."],"tags":["migration","comments","storage","dolt"],"backgroundTag":"storage-read-failure","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}