Skip to content

gh issue create errors after successful creation when issue type can't be set #13804

Open

Agent suggestions

Public preview

Description

@LangLangBart

Describe the bug

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

  1. gh issue create --repo on a repo where you cant set the type
  2. 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)

Activity

  1. added
    needs-triage
    on Jul 6, 2026
  2. LangLangBart commented on Jul 6, 2026

    @LangLangBart
    Author

    I dont remember seeing this error 3 months ago.

    Potentially introduced with #13057 (not verified)

  3. cli-triage commented on Jul 9, 2026

    @cli-triage

    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).

    Generated by Issue Triage (skills-driven) · 26 AIC · ⌖ 6.57 AIC · ⊞ 5K · ◷

  4. added a commit that references this issue on Jul 16, 2026
    c82266c
  5. imkp1 commented on Jul 16, 2026

    @imkp1

    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?

  6. added
    bug
    gh-issue
    priority-3
    and removed
    needs-triage
    on Jul 17, 2026
  7. BagToad commented on Jul 17, 2026

    @BagToad
    Member

    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.

  8. imkp1 commented on Jul 17, 2026

    @imkp1

    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.

  9. imkp1 commented on Jul 20, 2026

    @imkp1

    @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.

  10. coygeek commented on Oct 30, 2026

    @coygeek

    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.

    The fixture ran:

    gh issue create --repo fixture-owner/fixture-repo --title 'Fixture title' --body 'Fixture body' --type Bug

    It returned HTTP 200 GraphQL responses in this observed order:

    1. IssueRepositoryInfo: issues enabled, repository ID REPOID, viewer permission READ.
    2. IssueCreate: success, returning issue ID ISSUEID and URL https://github.com/fixture-owner/fixture-repo/issues/123.
    3. RepositoryIssueTypes: a valid Bug type with ID IT_BUG.
    4. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggh-issuepriority-3stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions