To reproduce: use GDK master, clone a repo with git clone --depth=1. You need to set GITALY_POST_UPLOAD_PACK=1 on Unicorn in the Procfile.
$ git clone --bare --depth=1 http://localhost:3000/foo/bar.gitCloning into bare repository 'bar.git'...fatal: protocol error: bad line length character: Inte
We cannot turn on this RPC in production without proper support for shallow clone.
This looks like a subtle problem in workhorse. From a gRPC standpoint, we have a failing PostUploadPack RPC. We handle this error in workhorse by calling helper.Fail500. Helper.Fail500 writes Internal server error' to the response. This corrupts the response cause git clone` to fail.
If we want to be able to print that message perhaps we should use a http.ResponseWriter that triggers on WriteHeader(500) and writes that error into the response body only if nothing has been written yet.
WriteHeader() has no effect if the response body has already been written to. This is pointing to a bug further up in the workhorse code, I think. We shouldn't be using Fail500 in cases where we may have already written to w.
Jacob Vosmaer (GitLab)changed title from PostUploadPack does not support shallow clone to Gitaly PostUploadPack does not support shallow clone
changed title from PostUploadPack does not support shallow clone to Gitaly PostUploadPack does not support shallow clone