{"record":{"id":"8d4cf544f67ef9bb","repo":"cli/cli","slug":"resolving-blocking-reference-q-w","errorCode":null,"errorMessage":"resolving --blocking reference %q: %w","messagePattern":"resolving --blocking reference %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/issue/create/create.go","lineNumber":477,"sourceCode":"\t\tparentID, err := issueShared.ResolveIssueRef(client, baseRepo, opts.Parent)\n\t\tif err != nil {\n\t\t\treturn api.DeferredUpdateIssueOptions{}, fmt.Errorf(\"resolving --parent reference %q: %w\", opts.Parent, err)\n\t\t}\n\t\tupdateOpts.ParentID = parentID\n\t}\n\n\tfor _, ref := range opts.BlockedBy {\n\t\tid, err := issueShared.ResolveIssueRef(client, baseRepo, ref)\n\t\tif err != nil {\n\t\t\treturn api.DeferredUpdateIssueOptions{}, fmt.Errorf(\"resolving --blocked-by reference %q: %w\", ref, err)\n\t\t}\n\t\tupdateOpts.AddBlockedByIDs = append(updateOpts.AddBlockedByIDs, id)\n\t}\n\n\tfor _, ref := range opts.Blocking {\n\t\tid, err := issueShared.ResolveIssueRef(client, baseRepo, ref)\n\t\tif err != nil {\n\t\t\treturn api.DeferredUpdateIssueOptions{}, fmt.Errorf(\"resolving --blocking reference %q: %w\", ref, err)\n\t\t}\n\t\tupdateOpts.AddBlockingIDs = append(updateOpts.AddBlockingIDs, id)\n\t}\n\n\treturn updateOpts, nil\n}\n","sourceCodeStart":459,"sourceCodeEnd":484,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/issue/create/create.go#L459-L484","documentation":"Thrown by gh issue create when ResolveIssueRef fails for one of the --blocking references. Identical mechanics to --blocked-by: each ref must resolve to an existing issue ID in the mutation payload; the first unresolvable ref aborts the whole create.","triggerScenarios":"`gh issue create --blocking 55` where #55 does not exist, is a PR, or belongs to another repo referenced without the OWNER/REPO#n form.","commonSituations":"Mirrors 833: stale numbers in automation, cross-repo planning, refs copied from a different tracker export.","solutions":["Validate each number beforehand with `gh issue view OWNER/REPO#<n>`.","Qualify cross-repo refs as OWNER/REPO#n.","Create first without --blocking, then add links via `gh issue edit` after verifying numbers."],"exampleFix":"# before\ngh issue create --title \"x\" --blocking 55\n# gh: resolving --blocking reference \"55\": ...\n\n# after\ngh issue view owner/repo#55   # exists and is an issue\ngh issue create --title \"x\" --blocking owner/repo#55","handlingStrategy":"validation","validationCode":"for _, ref := range opts.Blocking {\n\tif _, err := issueShared.ResolveIssueRef(client, baseRepo, ref); err != nil {\n\t\treturn fmt.Errorf(\"pre-check failed for %q: %w\", ref, err)\n\t}\n}","typeGuard":"func isBlockingRefErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"resolving --blocking reference\")\n}","tryCatchPattern":"if err := createRun(opts); err != nil {\n\tif isBlockingRefErr(err) {\n\t\t// extract the quoted ref, confirm with gh issue view, correct, retry\n\t}\n}","preventionTips":["Verify each --blocking number exists and is an issue before create.","Use OWNER/REPO#n for cross-repo references.","Keep blocking/blocked-by lists sourced from live API queries, not stale exports."],"tags":["issue","references","blocking","validation"],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}