cli/cli · error

resolving --remove-blocked-by reference %q: %w

Error message

resolving --remove-blocked-by reference %q: %w

What it means

Thrown by gh issue edit when a --remove-blocked-by reference cannot be resolved to a node ID via ResolveIssueRef. As with other relationship flags, all references are resolved up front; one unresolvable value fails the entire update.

Source

Thrown at pkg/cmd/issue/edit/edit.go:521

	for _, ref := range editOpts.RemoveSubIssues {
		id, err := issueShared.ResolveIssueRef(client, baseRepo, ref)
		if err != nil {
			return api.DeferredUpdateIssueOptions{}, fmt.Errorf("resolving --remove-sub-issue reference %q: %w", ref, err)
		}
		updateOpts.RemoveSubIssueIDs = append(updateOpts.RemoveSubIssueIDs, id)
	}

	for _, ref := range editOpts.AddBlockedBy {
		id, err := issueShared.ResolveIssueRef(client, baseRepo, ref)
		if err != nil {
			return api.DeferredUpdateIssueOptions{}, fmt.Errorf("resolving --add-blocked-by reference %q: %w", ref, err)
		}
		updateOpts.AddBlockedByIDs = append(updateOpts.AddBlockedByIDs, id)
	}
	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)
	}

View on GitHub (pinned to 0eeec0b92e)

Solutions

  1. Pass the valid issue number or same-host URL currently blocking the issue
  2. Inspect current relationships (gh issue view N --json blockedBy) and use those numbers
  3. If the blocker was deleted, drop the flag; the edge is typically removed with the node

Example fix

# before
gh issue edit 3 --remove-blocked-by old-blocker
# after
gh issue edit 3 --remove-blocked-by 99
Defensive patterns

Strategy: validation

Validate before calling

gh issue view <N> -R <owner>/<repo> --json blockedBy --jq '.blockedBy[].number'

Prevention

When it happens

Trigger: Running 'gh issue edit N --remove-blocked-by <ref>' with a malformed, deleted, cross-host, or unreadable issue reference.

Common situations: Removing dependency links for issues that were deleted or moved; stale automation state; incorrect ref formatting in scripts.

Related errors


AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15). Data as JSON: /api/errors/aaff592b050fb6d7. Report an issue: GitHub.