You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh issue create errors after successful creation when issue type can't be set #13804
gh issue create shows an error message with "does not have the correct
permissions to execute UpdateIssueIssueType" - even though the issue was
created successfully. Occurs only when you dont have the right permissions on
the repo.
Affected version
gh version 2.96.0 (2026-07-02)
Steps to reproduce the behavior
gh issue create --repo on a repo where you cant set the type
See the error
Expected vs actual behavior
Expected: Issue created, no error message.
Actual: Issue created, then X operation failed... GraphQL: does not
have the correct permissions to execute UpdateIssueIssueType.
Logs
gh issue create --repo cli/cli
Creating issue in cli/cli
? Title (required) `gh issue create` errors after successful creation when issue type can't be set? Choose a template 🐛 Bug report? Body <Received>? Issue type Bug? What's next? Submit
X operation failed. To restore: gh issue create --recover /var/folders/n6/x5dgkb0j4mncg9_0l47pyzr80000gn/T/gh2543392225.json
GraphQL: LangLangBart does not have the correct permissions to execute `UpdateIssueIssueType` (updateIssueIssueType)
This is a confirmed bug with clear reproduction steps and logs. The issue is created successfully, but gh issue create then attempts to set the issue type via a UpdateIssueIssueType GraphQL mutation - and when that fails due to insufficient permissions, it surfaces a misleading "X operation failed" error that implies the entire operation failed (including the confusing recovery prompt). Since setting the issue type is a secondary operation after successful creation, this permission failure should either be handled silently or with a non-fatal warning. Suggesting bug and priority-2 (affects any contributor filing issues on repos they don't own, which is a very common open-source workflow, and the misleading error could cause duplicate issue submissions).
Can confirm #13057 — that's where the DeferredUpdateIssue call came in. Before it, createRun never touched the issue after creating it, and the UpdateIssueIssueType mutation in your log didn't exist yet. The named return and PreserveInput were already there; the new call just assigns straight into err, so PreserveInput sees a non-nil error and writes the recovery file.
The issue does get created though — this fires afterwards when it tries to set the type, so --recover would just make a duplicate.
Put a fix up in #13899 — warn on stderr, still print the URL. Left the type "Bugz" not found errors fatal since those happen before the issue exists.
Any chance someone could add help wanted if that's the right direction?
Short version: on top of warning instead of failing when a deferred update errors, the type picker is now gated on repo.ViewerCanTriage(), so viewers who can't set a type aren't offered one in the first place. Flagged one thing on the PR I couldn't verify — whether TRIAGE is exactly the right boundary.
@BagToad following up on the help wanted label here — the bot flagged #13899 as unmet-requirements since this issue doesn't have it. I've put the PR back in draft to stop the auto-close timer, so no rush on my end.
The PR has your requested change pushed and one open question on the permission boundary. Happy to keep iterating either way.
Additional current-release evidence for the noninteractive --type path: this is still present in GitHub CLI v2.103.3 (the latest published release when checked). I reproduced the CLI's response handling with an isolated Unix HTTP transport fixture and dummy authentication; this was not a new live GitHub issue creation.
It returned HTTP 200 GraphQL responses in this observed order:
IssueRepositoryInfo: issues enabled, repository ID REPOID, viewer permission READ.
IssueCreate: success, returning issue ID ISSUEID and URL https://github.com/fixture-owner/fixture-repo/issues/123.
RepositoryIssueTypes: a valid Bug type with ID IT_BUG.
UpdateIssueIssueType: the following error response:
{"data":{"updateIssueIssueType":null},"errors":[{"type":"FORBIDDEN","path":["updateIssueIssueType"],"message":"fixture-user does not have the correct permissions to execute `UpdateIssueIssueType`"}]}
Observed result: exit status 1, zero bytes on stdout, and this stderr:
GraphQL: fixture-user does not have the correct permissions to execute `UpdateIssueIssueType` (updateIssueIssueType)
Two controls, each run once with the same creation response, both exited 0 and printed the returned issue URL: a successful type-update response ({"data":{"updateIssueIssueType":{"issue":{"id":"ISSUEID"}}}}), and omitting --type altogether. The denied-update case was also run once. All account/repository/issue identifiers above are synthetic fixture values.
The current default branch still has the same ordering: createRun returns on the deferred-update error before printing newIssue.URL. That file and api/queries_issue.go are identical between the release and this trunk snapshot. Trunk was inspected statically, not built or executed.
This verifies the missing-URL behavior without relying on live permission-policy assumptions. The permission denial itself is not the defect: after a successful creation response, exposing the created URL while separately reporting the metadata failure would let callers distinguish partial success before considering a retry.
Activity
LangLangBart commentedon Jul 6, 2026
I dont remember seeing this error 3 months ago.
Potentially introduced with #13057 (not verified)
cli-triage commentedon Jul 9, 2026
This is a confirmed bug with clear reproduction steps and logs. The issue is created successfully, but
gh issue createthen attempts to set the issue type via aUpdateIssueIssueTypeGraphQL mutation - and when that fails due to insufficient permissions, it surfaces a misleading "X operation failed" error that implies the entire operation failed (including the confusing recovery prompt). Since setting the issue type is a secondary operation after successful creation, this permission failure should either be handled silently or with a non-fatal warning. Suggestingbugandpriority-2(affects any contributor filing issues on repos they don't own, which is a very common open-source workflow, and the misleading error could cause duplicate issue submissions).Warn instead of failing when issue fields can't be set
imkp1 commentedon Jul 16, 2026
Can confirm #13057 — that's where the
DeferredUpdateIssuecall came in. Before it,createRunnever touched the issue after creating it, and theUpdateIssueIssueTypemutation in your log didn't exist yet. The named return andPreserveInputwere already there; the new call just assigns straight intoerr, soPreserveInputsees a non-nil error and writes the recovery file.The issue does get created though — this fires afterwards when it tries to set the type, so
--recoverwould just make a duplicate.Put a fix up in #13899 — warn on stderr, still print the URL. Left the
type "Bugz" not founderrors fatal since those happen before the issue exists.Any chance someone could add
help wantedif that's the right direction?BagToad commentedon Jul 17, 2026
Thanks for the investigation @imkp1. I agree with most of the direction of your PR, but I'm asking for a bit more to the UX. Left a comment on the PR.
imkp1 commentedon Jul 17, 2026
Thanks @BagToad — pushed that in 8fbdb9b, details on #13899.
Short version: on top of warning instead of failing when a deferred update errors, the type picker is now gated on
repo.ViewerCanTriage(), so viewers who can't set a type aren't offered one in the first place. Flagged one thing on the PR I couldn't verify — whether TRIAGE is exactly the right boundary.imkp1 commentedon Jul 20, 2026
@BagToad following up on the
help wantedlabel here — the bot flagged #13899 as unmet-requirements since this issue doesn't have it. I've put the PR back in draft to stop the auto-close timer, so no rush on my end.The PR has your requested change pushed and one open question on the permission boundary. Happy to keep iterating either way.
coygeek commentedon Oct 30, 2026
Additional current-release evidence for the noninteractive
--typepath: this is still present in GitHub CLI v2.103.3 (the latest published release when checked). I reproduced the CLI's response handling with an isolated Unix HTTP transport fixture and dummy authentication; this was not a new live GitHub issue creation.The fixture ran:
It returned HTTP 200 GraphQL responses in this observed order:
IssueRepositoryInfo: issues enabled, repository IDREPOID, viewer permissionREAD.IssueCreate: success, returning issue IDISSUEIDand URLhttps://github.com/fixture-owner/fixture-repo/issues/123.RepositoryIssueTypes: a validBugtype with IDIT_BUG.UpdateIssueIssueType: the following error response:{"data":{"updateIssueIssueType":null},"errors":[{"type":"FORBIDDEN","path":["updateIssueIssueType"],"message":"fixture-user does not have the correct permissions to execute `UpdateIssueIssueType`"}]}Observed result: exit status 1, zero bytes on stdout, and this stderr:
Two controls, each run once with the same creation response, both exited 0 and printed the returned issue URL: a successful type-update response (
{"data":{"updateIssueIssueType":{"issue":{"id":"ISSUEID"}}}}), and omitting--typealtogether. The denied-update case was also run once. All account/repository/issue identifiers above are synthetic fixture values.The current default branch still has the same ordering:
createRunreturns on the deferred-update error before printingnewIssue.URL. That file andapi/queries_issue.goare identical between the release and this trunk snapshot. Trunk was inspected statically, not built or executed.This verifies the missing-URL behavior without relying on live permission-policy assumptions. The permission denial itself is not the defect: after a successful creation response, exposing the created URL while separately reporting the metadata failure would let callers distinguish partial success before considering a retry.