Cyberithub

Solved "git push error: RPC failed: HTTP 500 curl 22 The requested URL returned error"

Advertisements

In this article, we will see how to solve "git push error: RPC failed: HTTP 500 curl 22 The requested URL returned error: 500" which can occur during git push operation to a remote branch in a repo of a Git Server. You might be using any of the git server such as GitHub, GitLab, Bitbucket etc. This error can occur anytime on any of these servers while pushing changes to your remote branch.

In my case, I am using GitHub server where I tried pushing my changes by running git push command from my local terminal but I was unable to due to the error encountered. I am sure many of you are also facing this issue so I have decided to write an article about this explaining the problem here along with the solution to apply to solve this problem.

 

Solved "git push error: RPC failed: HTTP 500 curl 22 The requested URL returned error"

Solved "git push error: RPC failed: HTTP 500 curl 22 The requested URL returned error"

Also Read: Solved "git push fatal: 'origin' does not appear to be a git repository"

As I was explaining, I basically tried pushing my changes to a remote branch in my project repo using git push command but I was unable to due to below error encountered as shown on the output.

cyberithub@ubuntu:~$ git push origin cyberpro

Enumerating objects: 786, done
Counting objects: 100% (786/786), done
Delta compression using up to 12 threads
Compressing objects: 100% (770/770), done
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (775/775), 9.38 MiB | 4.21 MiB/s, done.
Total 775 (delta 172), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

After checking this issue for a while, I found that the local default buffer size assigned for performing HTTP POST request were not enough to push large number of changes over https to Git Server. This required me to increase the client-side buffer size. So to fix this error, I increased maximum size (in bytes) of the buffer used for HTTP POST operations to 524,288,000 bytes (approximately 500 MB) using git config --global http.postBuffer 524288000 command as shown below. This immediately fixed my error.

cyberithub@ubuntu:~$ git config --global http.postBuffer 524288000

You can also verify the changes done by listing all global configuration settings using git config --global -l command as shown below.

cyberithub@ubuntu:~$ git config --global -l

Sometimes, it is also possible that instead of pushing large number of changes, you may be pushing few very large size files then in that case also you will get same "error: RPC failed: HTTP 500 curl 22 The requested URL returned error: 500" and to fix this error you have to apply the same solution as explained above.

In case, if you no longer need the larger buffer size, you can reset it back to the default size using git config --global --unset http.postBuffer command as shown below.

cyberithub@ubuntu:~$ git config --global --unset http.postBuffer

But here one important point is to note that above solution only increases the client-side buffer size, it does not do any changes in remote git server. If in case you are encountering this error due to remote server limit then in that case you have to update the remote server configuration. Hope this article helped you in solving this git push error. Please let me know your feedback in the comment box.

Leave a Comment