{"record":{"id":"a274985dfa3b3ffe","repo":"gastownhall/beads","slug":"node-q-setting-assignee-w","errorCode":null,"errorMessage":"node %q: setting assignee: %w","messagePattern":"node %q: setting assignee: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/graph_apply.go","lineNumber":1097,"sourceCode":"\t\t\t\t\tif graphApplySchedulingDependencyType(d.Type) {\n\t\t\t\t\t\tnewSchedulingEdges = append(newSchedulingEdges, [2]string{d.IssueID, d.DependsOnID})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cyclePath, err := tx.CycleThroughEdges(ctx, newSchedulingEdges); err != nil {\n\t\t\treturn fmt.Errorf(\"final graph cycle check: %w\", err)\n\t\t} else if cyclePath != \"\" {\n\t\t\treturn fmt.Errorf(\"graph dependency cycle would be created: %s\", cyclePath)\n\t\t}\n\n\t\t// Apply deferred assignees.\n\t\tfor i, assignee := range pendingAssignees {\n\t\t\tupdates := map[string]interface{}{\n\t\t\t\t\"assignee\": assignee,\n\t\t\t}\n\t\t\tif err := tx.UpdateIssue(ctx, issues[i].ID, updates, actor); err != nil {\n\t\t\t\treturn fmt.Errorf(\"node %q: setting assignee: %w\", plan.Nodes[i].Key, err)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &GraphApplyResult{IDs: keyToID}, nil\n}\n\n// validateGraphApplyPlannedBlockingCycles rejects planned blocking edges that\n// would close a blocking-dependency cycle, evaluated whole-graph before any\n// insert. This early preflight is restricted to blocking edges for precise\n// plan errors. Each stored edge still runs issueops.CheckDependencyCycleInTx,\n// which enforces the combined blocks + conditional-blocks + parent-child graph.\nfunc validateGraphApplyPlannedBlockingCycles(ctx context.Context, tx storage.Transaction, plan *GraphApplyPlan, keyToID map[string]string) error {\n\ttype plannedEdge struct {","sourceCodeStart":1079,"sourceCodeEnd":1115,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/graph_apply.go#L1079-L1115","documentation":"After dependencies are applied, graph apply sets each node's deferred assignee via tx.UpdateIssue. This error wraps a failure of that update — the dependencies were written but the assignee field could not be persisted — and the whole transaction (including the deps) is rolled back.","triggerScenarios":"tx.UpdateIssue(ctx, issues[i].ID, {\"assignee\": assignee}, actor) errors during the pendingAssignees loop, e.g. storage failure, issue row missing, or an invalid assignee value rejected by the backend.","commonSituations":"Assignee values violating DB constraints, storage connectivity problems late in a long transaction, or concurrent writers deleting/altering the issue mid-apply.","solutions":["Check the wrapped error for the storage-level cause","Verify the assignee value is a valid identity accepted by the backend","Ensure no concurrent process is modifying the same issues during apply","Retry the apply once storage is healthy — the transaction guarantees atomicity"],"exampleFix":"// before\n{\"assignee\":\"\"} // empty value rejected\n// after\n{\"assignee\":\"alice\"}","handlingStrategy":"try-catch","validationCode":"for i, a := range pendingAssignees {\n  if !validAssignee(a) { return fmt.Errorf(\"invalid assignee %q for node %q\", a, plan.Nodes[i].Key) }\n}","typeGuard":"func assigneesValid(plan Plan) bool {\n  return every(plan.Nodes, func(n Node) bool { return n.Assignee == \"\" || validAssignee(n.Assignee) })\n}","tryCatchPattern":"if err := bd.GraphApply(ctx, plan); err != nil {\n  if strings.Contains(err.Error(), \"setting assignee\") {\n    // transaction rolled back; fix assignee values and retry\n    return bd.GraphApply(ctx, sanitizeAssignees(plan))\n  }\n  return err\n}","preventionTips":["Validate assignee identifiers before applying","Avoid concurrent issue updates during graph apply","Remember applies are atomic — a late assignee failure rolls back all deps, so retry is safe"],"tags":["beads","graph-apply","update-issue","storage"],"backgroundTag":"issue-update-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}