Skip to content

HTTP 414: Request-URI too large #1575

@ahayworth

Description

@ahayworth

Describe the bug

Today, whilst filling out a PR, I accidentally selected 'continue in browser' instead of 'submit'. Unfortunately, I was greeted with an HTTP 414 Request-URI too large error in my browser:

nginx http 414 error page

Steps to reproduce the behavior

  1. gh pr create
  2. Select e to edit the body, and type a lot of text (the repo I was submitting a PR against had a PR template, which is quite lengthy)
  3. Select 'continue in browser'
  4. 💥 💥 💥

Expected vs actual behavior

Expected behavior: The CLI should warn that it cannot continue in the browser; and/or possibly remove the option since it will not succeed.
Actual behavior: HTTP 414

Notably, RFC 3986 doesn't define a maximum length for URIs. Normally this would be a barrier to better CLI behavior. However, various parts of the stack internally do have length limits (implicitly in at least one case, possibly explicitly as well), so we should be able to track down what a safe limit might be, and take appropriate action in the CLI when a PR would exceed that.

Logs

❯ gh pr create

Creating pull request for ahayworth-<redacted>-fix-customers into master in github/<redacted>

? Title Update <redacted>
? Body <Received>
? What's next? Continue in browser
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 12 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 1.51 KiB | 1.51 MiB/s, done.
Total 8 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote:
remote: Create a pull request for 'ahayworth-<redacted>-fix-customers' on GitHub by visiting:
remote:      https://github.com/github/<redacted>/pull/new/ahayworth-<redacted>-fix-customers
remote:
To github.com:github/<redacted>
 * [new branch]          HEAD -> ahayworth-<redacted>-fix-customers
Branch 'ahayworth-<redacted>-fix-customers' set up to track remote branch 'ahayworth-<redacted>-fix-customers' from 'origin'.
Opening github.com/github/<redacted>/compare/master...ahayworth-<redacted>-fix-customers in your browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions