cli/cli · error
resolving --remove-blocking reference %q: %w
Error message
resolving --remove-blocking reference %q: %w
What it means
Thrown by gh issue edit when a --remove-blocking reference cannot be resolved to a node ID via ResolveIssueRef. It is the last of the relationship-resolution loops in deferredUpdateIssueOptions; any unresolvable reference fails the whole edit before any API mutation is sent.
Source
Thrown at pkg/cmd/issue/edit/edit.go:536
for _, ref := range editOpts.RemoveBlockedBy {
id, err := issueShared.ResolveIssueRef(client, baseRepo, ref)
if err != nil {
return api.DeferredUpdateIssueOptions{}, fmt.Errorf("resolving --remove-blocked-by reference %q: %w", ref, err)
}
updateOpts.RemoveBlockedByIDs = append(updateOpts.RemoveBlockedByIDs, id)
}
for _, ref := range editOpts.AddBlocking {
id, err := issueShared.ResolveIssueRef(client, baseRepo, ref)
if err != nil {
return api.DeferredUpdateIssueOptions{}, fmt.Errorf("resolving --add-blocking reference %q: %w", ref, err)
}
updateOpts.AddBlockingIDs = append(updateOpts.AddBlockingIDs, id)
}
for _, ref := range editOpts.RemoveBlocking {
id, err := issueShared.ResolveIssueRef(client, baseRepo, ref)
if err != nil {
return api.DeferredUpdateIssueOptions{}, fmt.Errorf("resolving --remove-blocking reference %q: %w", ref, err)
}
updateOpts.RemoveBlockingIDs = append(updateOpts.RemoveBlockingIDs, id)
}
return updateOpts, nil
}
View on GitHub (pinned to 0eeec0b92e)
Solutions
- Pass the valid issue number or same-host URL that this issue currently blocks
- List current blocking issues via gh issue view N --json blocking and reuse those numbers
- Skip the flag if the target issue no longer exists
Example fix
# before gh issue edit 3 --remove-blocking "#old" # after gh issue edit 3 --remove-blocking 20
Defensive patterns
Strategy: validation
Validate before calling
gh issue view <N> -R <owner>/<repo> --json blocking --jq '.blocking[].number'
Prevention
- Use the issue's current blocking list as the source for removal numbers
- Ignore refs whose issues no longer exist
- Prefer numbers over URLs in batch cleanup
When it happens
Trigger: Running 'gh issue edit N --remove-blocking <ref>' where the ref is malformed, deleted, on another host, or not readable by the token.
Common situations: Cleanup scripts removing dependency edges for deleted issues; stale inventories; formatting mistakes in batch commands.
Related errors
- resolving --add-blocking reference %q: %w
- resolving --parent reference %q: %w
- resolving --add-sub-issue reference %q: %w
- resolving --remove-sub-issue reference %q: %w
- resolving --add-blocked-by reference %q: %w
AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15).
Data as JSON: /api/errors/d5b4ede2993ddbaa.
Report an issue: GitHub.