Skip to content

gh api call to add sub-issue fails with HTTP/2.0 500 Internal Server Error #10378

@bobneuman

Description

@bobneuman

Describe the bug

When I attempt to add an issue as a sub_issue using the gh api --verbose call (see ref) the response contains HTTP/2.0 500 Internal Server Error and the sub issue is not set.

I can create the parent and sub issue; therefore, the need for "Issues" repository permissions (write) is met. I've tried this with both the issue number and issue id.

Affected version

gh version 2.65.0 (2025-01-06)
https://github.com/cli/cli/releases/tag/v2.65.0

Steps to reproduce the behavior

  1. Set Org and Repo environment variables.
    export OWNER=YOUR_ORG; export REPO=TEST_REPO
  1. Create two issues and save the response data
    Parent:
      gh api --method POST \
     -H "Accept: application/vnd.github+json" \
     -H "X-GitHub-Api-Version: 2022-11-28" \
     "/repos/$OWNER/$REPO/issues" \
     -F "title=Issue Parent" \
     -F "body=Issue description"

Sub Issue:

      gh api --method POST \
     -H "Accept: application/vnd.github+json" \
     -H "X-GitHub-Api-Version: 2022-11-28" \
     "/repos/$OWNER/$REPO/issues" \
     -F "title=Sub Issue" \
     -F "body=Issue description"
  1. Set the issue environment variables
  export ISSUE_NUMBER=[ISSUE NUMBER FROM PARENT ISSUE RESPONSE DATA]
  export SUB_ISSUE_ID=[ISSUE NUMBER FROM SUB ISSUE RESPONSE DATA]
  1. Attempt to set the sub issue per
  gh api --verbose \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/$OWNER/$REPO/issues/$ISSUE_NUMBER/sub_issues \
   -F "sub_issue_id=$SUB_ISSUE_ID"
  1. See HTTP/2.0 500 Internal Server Error in the response

Logs

Paste the activity from your command line. Redact if needed.

* Request at 2025-02-06 08:21:08.098032 -0500 EST m=+0.141797293
* Request to https://api.github.com/repos/[REDACTED]/[REDACTED]/issues/[REDACTED]/sub_issues
> POST /repos/[REDACTED]/[REDACTED]/issues/[REDACTED]/sub_issues HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github+json
> Authorization: token [REDACTED]
> Content-Length: 21
> Content-Type: application/json; charset=utf-8
> Time-Zone: America/New_York
> User-Agent: GitHub CLI 2.65.0
> X-Github-Api-Version: 2022-11-28

{
  "sub_issue_id": [REDACTED]
}

< HTTP/2.0 500 Internal Server Error
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< Content-Length: 0
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Thu, 06 Feb 2025 13:21:08 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: github.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Api-Version-Selected: 2022-11-28
< X-Github-Media-Type: github.v3; format=json
< X-Github-Request-Id: [REDACTED]
< X-Oauth-Client-Id: [REDACTED]
< X-Oauth-Scopes: gist, project, read:org, repo, workflow
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4989
< X-Ratelimit-Reset: 1738850113
< X-Ratelimit-Resource: core
< X-Ratelimit-Used: 11
< X-Xss-Protection: 0

* Request took 343.284416ms

Metadata

Metadata

Assignees

Labels

needs-user-inputplatformProblems with the GitHub platform rather than the CLI client

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions