Interview blog

error: RPC failed; HTTP 408 curl 22: How to Fix It

Written February 5, 2026Updated October 23, 20268 min read
How Should You Handle Error Pushing To GitHub RPC Failed HTTP 408 cURL 22 During An Interview Or Professional Call

What git's HTTP 408 / curl 22 push error means, why raising http.postBuffer rarely helps, and the fixes that do: smaller pushes, SSH, Git LFS.

If git push stops with error: RPC failed; HTTP 408 curl 22 The requested URL returned error: 408, the server stopped waiting for your upload and closed the connection before it finished. Nothing is wrong with your commits. The upload took too long or stalled. In practice it usually comes down to one of three causes: the push is too big, the network is too slow or unstable, or the host is having a bad moment. The fixes, roughly in order: retry on a better connection, push less at once, take large files out of the push, or switch the remote from HTTPS to SSH. Raising http.postBuffer, the usual first suggestion, is rarely the fix. Git's own documentation says why.

What each part of the message means

The error stacks three layers, and only one of them tells you anything new.

  • HTTP 408 Request Timeout. The server decided to close the connection rather than keep waiting. MDN notes that a server sending 408 should also send Connection: close, because the 408 means it has given up on the connection.
  • curl 22. Git talks HTTP through libcurl. In curl's list of exit codes, 22 means the server returned an HTTP status of 400 or above. It is curl passing on the 408, not a second problem.
  • RPC failed. Git's smart HTTP transport sends your pack as a POST request. That request is what failed.

Lines that often follow, such as send-pack: unexpected disconnect while reading sideband packet or fatal: the remote end hung up unexpectedly, are git reporting that the connection dropped partway through. They describe the same event. So the real question is: why did this upload run long enough, or stall long enough, for the server to give up?

Diagnose it in two minutes

Run these before you change any settings. Each one rules a cause in or out.

1. How much are you pushing? List the largest files in commits that no remote has yet:

git rev-list --objects HEAD --not --remotes \
  | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
  | awk '$1 == "blob"' | sort -k3 -n | tail -10

The third column is the size in bytes. git count-objects -vH shows the size of the whole repository's packs (size-pack). If one file is tens of megabytes, or the new history adds up to hundreds, size is your likely cause.

2. Is it the network? Try git fetch. If small requests work but the push fails every time at roughly the same point, size is more likely than the connection. If the failure point moves around, or a speed test on the same connection is poor, suspect the network. A VPN or office network adds another hop that can drop a slow upload, so try without it if you can.

3. Is it GitHub? Check the Git Operations row on githubstatus.com. If it shows an incident, wait. Nothing local will fix it.

4. Still unclear? Rerun the push with tracing on:

GIT_TRACE_CURL=1 GIT_TRACE_CURL_NO_DATA=1 git push

GIT_TRACE_CURL dumps the HTTP exchange, and GIT_TRACE_CURL_NO_DATA keeps it to headers and info lines so the pack data does not flood your terminal. You will see how long the request ran before the 408 came back.

  • What you found — Likely cause — Go to
  • A large file, or hundreds of MB of new history — Push size — Fixes 2 and 3
  • Small push, failure point moves around — Network — Fixes 1 and 4
  • Incident on githubstatus.com — Host side — Wait and retry
  • Fails only on HTTPS, every time — HTTP path (proxy, VPN, network) — Fix 4

Fixes that work, in order

1. Retry on a better connection

Because a 408 is a timeout, a wired connection or a different network is the cheapest thing to try. If a fresh retry on a fast, stable connection goes through, you are done. If it fails at the same point again, the push is probably the problem.

2. Push less at once

You do not have to send all your new history in one request. Push an older commit first, then the rest:

git log --oneline --reverse origin/main..HEAD   # unpushed commits, oldest first
git push origin <older-commit-sha>:refs/heads/main
git push origin main

Each push then carries only part of the history. For very large repositories, GitHub documents the same approach for its 2 GiB single-push limit, including a short loop that pushes every 1,000th commit.

3. Take large files out of the push

GitHub warns about files over 50 MiB and blocks files over 100 MiB. To track files beyond that limit you must use Git LFS; for smaller large files, consider keeping them out of the repository.

If the large file is only in commits you have not pushed yet, remove it before pushing. For the last commit:

git rm --cached path/to/bigfile
echo "path/to/bigfile" >> .gitignore
git add .gitignore
git commit --amend

If it sits in an older unpushed commit, git reset --soft origin/main turns all your unpushed commits back into staged changes. Unstage the file with git rm --cached, then commit again. If the file is already in pushed history, GitHub's guide covers git lfs migrate and git filter-repo. Both rewrite history, so agree on it with anyone else who uses the repository.

4. Switch the remote to SSH

The SSH transport does not use HTTP, so an HTTP 408 cannot happen. A bad connection can still break the push, but in a different way. With an SSH key added to your GitHub account:

ssh -T git@github.com
git remote set-url origin git@github.com:OWNER/REPO.git
git push

A working key answers with "Hi USERNAME! You've successfully authenticated". If your network blocks port 22, GitHub also accepts SSH over port 443 at ssh.github.com. Test it with ssh -T -p 443 git@ssh.github.com, then add this to ~/.ssh/config:

Host github.com
    Hostname ssh.github.com
    Port 443
    User git

What about http.postBuffer?

git config http.postBuffer 524288000 is the fix you will see suggested most often. Here is what the setting does, according to git's documentation. When a push is larger than the buffer (1 MiB by default), git sends it with chunked transfer encoding. Raising the buffer only turns chunked encoding off. The docs say it should be used only when the server or a proxy supports nothing newer than HTTP/1.0 or does not follow the HTTP standard, and that raising it "is not, in general, an effective solution for most push problems". It also costs memory, because git allocates the whole buffer even for small pushes.

If you want to rule it out, try it for one push instead of setting it globally:

git -c http.postBuffer=524288000 push

If that push succeeds, something in your HTTP path may not handle chunked uploads well, and switching to SSH is a cleaner long-term fix. If it fails the same way, go back to size and network.

If this happens in a live coding interview or a take-home walkthrough

Don't turn the interview into a git debugging session. Say what happened in one sentence: "My push timed out, so I'll show you the code locally and push it after the call." Then carry on: share your editor, or paste the code into the interview's own environment. Interviewers usually care most about how you approach the problem, so a quick, calm workaround helps you get back to that.

The better fix is to keep it from happening. Push the repository the day before. Clone it fresh into another folder to check that everything arrived. Make sure no build output or datasets slipped into the commits. If the interview includes live coding, our technical round interview questions and LeetCode interview questions cover what usually comes up. During the coding round itself, Verve AI's Coding Copilot captures a coding question from your screen and returns a solution in 21+ programming languages.

Sources

  • HTTP 408 means the server closed the connection; it should send Connection: close: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/408
  • curl exit code 22 (HTTP status of 400 or above): https://curl.se/docs/manpage.html
  • http.postBuffer behaviour, 1 MiB default, "not, in general, an effective solution", memory cost: https://git-scm.com/docs/git-config
  • GIT_TRACE_CURL and GIT_TRACE_CURL_NO_DATA: https://git-scm.com/docs/git
  • git cat-file --batch-check format atoms (objecttype, objectname, objectsize, rest): https://git-scm.com/docs/git-cat-file
  • git count-objects size-pack and -H: https://git-scm.com/docs/git-count-objects
  • git remote set-url: https://git-scm.com/docs/git-remote
  • GitHub 2 GiB single-push limit, splitting a push, "remote end hung up unexpectedly": https://docs.github.com/en/get-started/using-git/troubleshooting-the-2-gb-push-limit
  • 50 MiB warning, 100 MiB block, Git LFS: https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github
  • git lfs migrate and filter-repo for files already in history: https://docs.github.com/en/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage
  • Testing an SSH connection, success message: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection
  • SSH over port 443 at ssh.github.com, config snippet: https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
  • Git Operations status component: https://www.githubstatus.com/
  • Coding Copilot (captures the question from the screen, 21+ languages): .claude/skills/seo-rewrite/references/facts.md; https://docs.vervecopilot.com/features/coding-copilot
R

Ryan

CEO of Verve AI

Related reads

Explore related blog posts

Dell Layoffs 2025: The 72-Hour Employee Playbook
May 30, 2026Interview blog

Dell Layoffs 2025: The 72-Hour Employee Playbook

Dell layoffs 2025, explained for affected employees and job seekers: who was hit, whether this is part of a longer headcount decline, what to do in the first 72

Read story
What Should You Know About Consultant Salary In Deloitte Before Your Interview
February 12, 2026Interview blog

What Should You Know About Consultant Salary In Deloitte Before Your Interview

Discover Deloitte consultant salary ranges, pay factors, and negotiation tips to prep for your interview.

Read story
How Can Deloitte Consultant Salary Knowledge Transform Your Interviews and Negotiations
March 2, 2026Interview blog

How Can Deloitte Consultant Salary Knowledge Transform Your Interviews and Negotiations

Use Deloitte consultant salary data to strengthen interview answers, negotiate better offers, and boost confidence.

Read story
How Can Consulting Salary Deloitte Shape Your Interview Strategy And Negotiation Outcomes
February 11, 2026Interview blog

How Can Consulting Salary Deloitte Shape Your Interview Strategy And Negotiation Outcomes

Discover how Deloitte consulting salaries influence interview strategy and improve negotiation outcomes.

Read story
What Should You Know About Deloitte Manager Consulting Salary Before Your Interview
March 17, 2026Interview blog

What Should You Know About Deloitte Manager Consulting Salary Before Your Interview

Discover key facts about Deloitte manager consulting salaries to prepare for interviews and negotiate offers.

Read story
How Should You Handle Deloitte Touche Salary Conversations In Interviews Sales Calls And Campus Events
March 16, 2026Interview blog

How Should You Handle Deloitte Touche Salary Conversations In Interviews Sales Calls And Campus Events

Practical tips to navigate Deloitte Touche salary discussions in interviews, sales calls, and campus events.

Read story
How Can Deloitte Company Salary Data Help Me Negotiate Confidently And Ace Interviews
March 12, 2026Interview blog

How Can Deloitte Company Salary Data Help Me Negotiate Confidently And Ace Interviews

Use Deloitte salary data to research pay ranges, negotiate offers, and prepare stronger interview answers.

Read story
How Can Demonstrating Property Manager Responsibilities Convince Interviewers And Win You The Role
February 3, 2026Interview blog

How Can Demonstrating Property Manager Responsibilities Convince Interviewers And Win You The Role

Learn how to demonstrate property manager responsibilities in interviews to convince hiring teams and win the role.

Read story
How Can You Demonstrate A Job For Safety Mindset In Interviews
February 4, 2026Interview blog

How Can You Demonstrate A Job For Safety Mindset In Interviews

Learn specific examples, answers, and behaviors to show a strong safety mindset in job interviews and stand out.

Read story

Walk into every interview prepared and confident

Get Started For Free

Available on Mac, Windows, browser and mobile