Repository navigation
Closed
Description
Hi,
I have a largish Git repo with 15k files (~8 GB) in GitLFS. On a particular machine the git lfs clone operation fails with this error:
batch response: Post https://<server>/<org>/<repo>.git/info/lfs/objects/batch: EOF
error: failed to push some objects to 'https://<server>/<org>/<repo>.git/info/lfs'
Environment:
- Windows 7
- Git 2.11
- Git LFS 2.1.1
- Git LFS config:
[lfs]
batch = true
ConcurrentTransfers = 10
[lfs "transfer"]
maxretries = 10
I was able to reproduce the problem with GIT_TRACE and GIT_CURL_VERBOSE enabled:
(in case it is relevant: there is no character/newline between }]}trace)
trace git-lfs: Filled credentials for https://<server>/<org>/<repo>.git
trace git-lfs: HTTP: POST https://<server>/<org>/<repo>.git/info/lfs/objects/batch
> POST /<org>/<repo>.git/info/lfs/objects/batch HTTP/1.1
> Host: <server>
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: Basic * * * * *
> Content-Length: 8936
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.1.1 (GitHub; windows amd64; go 1.8.1; git 3314e287)
>
{"operation":"download","objects":[{"oid":...many objects...}]}trace git-lfs: api error: Post https://<server>/<org>/<repo>.git/info/lfs/objects/batch: EOF
I wasn't able to pinpoint the problem, yet, but here are a few observations. Please note, the problem happens regularly but not all the time. Therefore an observation might not be be true in general (I don't have a large sample size as all operations take ages because of the large repo):
- I experienced the problem only with
git lfs clone.git lfs pullandgit lfs fetch(after deleteting all files in the worktree as well as.git/lfs) worked in all tests on the particular machine. - I was not able to reproduce the problem with Git LFS 1.5.6 (release version) on the particular machine.
- I was not able to reproduce the problem with Git LFS 2.1.1 compiled with golang 1.7.3 on the particular machine.
- I was not able to reproduce the problem with Git LFS 2.1.1 (release version, compiled with golang 1.8.1) on a machine running Windows 8 which is closer to the Git LFS server.
Questions
- The Batch API uses a HTTP POST operation to request the LFS objects. POST is defined non idempotent. That's why we generally cannot retry POST requests. However, the request of the LFS objects should be idempotent, no? Should we retry this request?
- The error
failed to push some objectsis a bit misleading to the user on a Git clone operation. Should we rephrase that? - Do you have any other idea how I could debug this further? I wonder if there is a bigger problem or just a flaky network that could be fixed with retries.
Thanks,
Lars
/cc @terrorobe
Metadata
Metadata
Assignees
Labels
No labels
Activity
terrorobe commentedon Jun 12, 2017
Just a small followup, for the single incident where we had the verbose curl output as well as the haproxy logs from the appliance, evidence pointed at the fact that the EOF'd batch request never reached the LFS server.
larsxschneider commentedon Jun 12, 2017
I compiled Git LFS 2.1.1 with golang 1.8.1. This should exactly match the currently released version. However, 3 different "clones" with the released version yield the error 3 times. 3 different "clones" with my own version did not fail once. Any idea what the problem might be? Just bad luck?
terrorobe commentedon Jun 13, 2017
3 experiments which are 3-0 against our shipped version looks like it's a statistically significant result.
I'm wondering if you could capture a failing session using mitmproxy's mitmdump. This would show us if the problem happens between the Git LFS process and the kernel or between your computer and the LFS server.
If you need help in configuring mitmproxy let me know. LFS will honour proxy configuration from both the git config and the environment.
ttaylorr commentedon Jun 13, 2017
Hey @larsxschneider 😄. Sorry you're having trouble. Sorry that you're having trouble; I'm pretty curious about why the issue only sometimes occurs. Here are a few other notes from your original issue:
As you noted, all of the POST requests that are defined in the LFS API are idempotent. We don't retry the request at a network/HTTP layer (source). That being said, for every failed item in a batch request (or all items, if the entire API call fails), the items are enqueued to be retried and are issued again in a new batch request (source). In effect, it should appear as if we are retrying the HTTP request multiple times.
I agree, I think that we should change that for the next version.
I'm not sure. I'm happy to dive in further, but at first blush this appears to be network related.
larsxschneider commentedon Jun 13, 2017
Thanks @ttaylorr !
I can see this error in the log:
Wouldn't that mean that I should see at least one other POST call that requests
{"operation":"download","objects":[{"oid":"ab1e49d0820fcf024268eeee7b750c0426a7128fde5d929c1aabdfc19cd67468",...?It's not there, although retry is activated. Is it possible there is a bug in the retry mechanism?
ttaylorr commentedon Jun 13, 2017
Interesting. That makes me think that whatever error that
tq.Batch()is returning is not "retriable" as according toerrors.IsRetriableError()(source, source & source).EDIT:
errors.NewRetriableError()has no callers in scope of thegithub.com/git-lfs/git-lfs/lfsapipackage:But I think that #2312 could help with this issue.
larsxschneider commentedon Jun 22, 2017
@ttaylorr When do you plan to release #2312 ? The "trouble" is that I cannot reproduce my problem with my own builds.
ttaylorr commentedon Jun 22, 2017
My plan is to release #2312 as a part of v2.2.0 on either this Friday (23 June, 2017) or the following Monday (26 June, 2017).
Were you unable to confirm a fix building against #2312?
larsxschneider commentedon Jun 22, 2017
Well, I was not able to reproduce the problem with my locally build v2.1.1. IOW: #2312 could not fix anything. I haven't analyzed the network traffic, yet, as suggested by @terrorobe .
ttaylorr commentedon Jun 22, 2017
I would be curious to see what the results of your findings are. I would also suggest to attach a Delve debugger session to LFS and see if you can figure out whether specific network errors cause that errors to be marked as retry-able or not.
If you decide to go this route, make sure to compile LFS with DWARF tables included (via
script/bootstrap --dwarf). You can run your built copy of LFS viadlv exec ./bin/git-lfs <args>with a fewruntime.Breakpoint()calls in the code.larsxschneider commentedon Jun 22, 2017
Can I attach the Delve debugger to the released version of Git LFS?
ttaylorr commentedon Jun 22, 2017
You would have to rebuild with the
--dwarfflag at thev2.1.1tag, since LFS releases are compiled without DWARF tables.larsxschneider commentedon Jun 22, 2017
As I said above: I am not able to reproduce the problem with a locally build GitLFS version of the
v2.1.1tag! I build with./script/bootstrap! Is this the way you build the official version?ttaylorr commentedon Jun 22, 2017
Ah, my mistake -- I had forgot you mentioned that in this thread.
This is how I compile the release binaries. The Linux packages require extra tooling, but are at their core running binaries built with
script/bootstrap.larsxschneider commentedon Jun 28, 2017
I just replicated the problem with the latest release
2.2.0which means #2312 does not fix the issue. Stay tuned for more detailed debugging infos.terrorobe commentedon Aug 1, 2017
After looking through a packet capture of the client we can now confirm that git-lfs does not create a TCP connection for the failing API requests, it errors out before that. The writeup in ZD#45772 contains detailed information.
@ttaylorr - Can you recommend a way on how to debug this problem further? We'd like to know why the requests are failing. Is there debug logging, tracing mechanism or similar approaches we can use to gather more information from inside Go?
gumparthisarma commentedon May 27, 2019
batch response: Unable to parse HTTP response for POST , still we are facing issues with this error.
gumparthisarma commentedon May 27, 2019
19:37:14.730320 trace git-lfs: HTTP: 200
Uploading LFS objects: 0% (0/1), 0 B | 0 B/s, done
batch response: Unable to parse HTTP response for POST /info/lfs/objects/batch: EOF
bk2204 commentedon May 28, 2019
Hey, could you open a new issue for this and run the command with
GIT_TRACE=1 GIT_TRANSFER_TRACE=1 GIT_CURL_VERBOSE=1? I think what you're seeing is possibly a different issue, and I'd like to handle it separately from this issue.bit-rocket commentedon Oct 29, 2021
I have come across the same issue.
And resolved by unset the git proxy settings.
http_proxy="socks5://127.0.0.1:1080"https_proxy="socks5://127.0.0.1:1080"