Git clone return result=18 code=200 on a specific repository

Nitay picture Nitay · Sep 2, 2012 · Viewed 13.6k times · Source

I'm trying to clone a internal repository from our company repository, and I keep getting this error:

error: RPC failed; result=18, HTTP code = 200

It always happens only after the repository have been completely downloaded (It takes a while).

I've tried using torotiseGit. Here is the report:

git.exe clone   --progress -v  "http://path/repository.git" "C:\Users\user\Documents\code\repository"

Cloning into 'C:\Users\user\Documents\code\repository'...
POST git-upload-pack (424 bytes)
remote: Compressing objects: 100% (4895/4895)   
Receiving objects: 100% (6970/6970), 61.89 MiB | 4.82 MiB/s
Resolving deltas: 100% (2610/2610)
Resolving deltas: 100% (2610/2610), done.
remote: Total 6970 (delta 2610), reused 5702 (delta 1672)
error: RPC failed; result=18, HTTP code = 200

git did not exit cleanly (exit code 128)

I've tried several times, from a Linux machine and from a windows machine. Same error

How can i further investigate the error? I couldn't find any useful information on Google

EDIT: I've checked the Apache logs on the Git server - There is a GET and a POST (with result 200) corresponding to each clone. The POST is a bit big (60MB) - So I've tried increasing the postBuffer to 500MB, but the error still occurs

Could this really be a git bug?

I wish it gave more informative errors...

Answer

andygavin picture andygavin · Aug 1, 2013

The error: RPC failed; result=18, HTTP code = 200 is a libcurl error.

From http://curl.haxx.se/libcurl/c/libcurl-errors.html we can see this is:

CURLE_PARTIAL_FILE (18)

A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.

You can set GIT_CURL_VERBOSE=1 before running a command like clone to understand how libcurl is failing. This might be done in bash with:

GIT_CURL_VERBOSE=1 git clone   --progress -v  ...

However given the error above you should try adjusting http.postBuffer. Try:

git config --global http.postBuffer 524288000

From here https://www.kernel.org/pub/software/scm/git/docs/git-config.html