go-git: `empty git-upload-pack given` errors since v5.4.0
We are extensive consumers of this library and besides the issue reported in #323, we have seen an increase of empty git-upload-pack given errors reported by our users since we upgraded from v5.3.0 to v5.4.x.
The error seems unrelated to the Git v2 protocol as reported in #64 or #157, given users that previously were able to perform operations on their e.g. GitHub repository using v5.3.0 are now no longer able to do so using v5.4.x.
~Diving into the changelog nothing directly related seems to have changed, except for some plumbing changes in #246.~
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 10
- Comments: 34 (10 by maintainers)
Commits related to this issue
- fix: empty git-upload-pack given on remote.fetch() More info: This change prevents an attempt to upload pack when UploadPackRequest is empty. Partial Resolution: #328 Signed-off-by: Paul Greenberg ... — committed to greenpau/go-git by greenpau 2 years ago
- fix: empty git-upload-pack given on remote.fetch() More info: This change prevents an attempt to upload pack when UploadPackRequest is empty. Partial Resolution: #328 Signed-off-by: Paul Greenberg ... — committed to rohankmr414/go-git by greenpau 2 years ago
- Downgrade go-git to 5.3.0 due to regression. See https://github.com/go-git/go-git/issues/328. — committed to metal-stack/metal-robot by Gerrit91 2 years ago
- GT: downgrading due to https://github.com/go-git/go-git/issues/328 — committed to practical-coder/gt by practical-coder a year ago
- fix pack from: https://github.com/go-git/go-git/issues/328 — committed to taigrr/mg by taigrr a year ago
- plumbing: packp, A request is not empty if it contains shallows. Fixes #328 Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com> — committed to AriehSchneier/go-git by AriehSchneier a year ago
- plumbing: packp, A request is not empty if it contains shallows. Fixes #328 Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com> — committed to AriehSchneier/go-git by AriehSchneier a year ago
- Merge pull request #792 from AriehSchneier/empty-fetch-with-shallows plumbing: packp, A request is not empty if it contains shallows. Fixes #328 — committed to go-git/go-git by pjbgf a year ago
- upgrade to fix github.com/go-git/go-git/issues/328 — committed to taigrr/mg by taigrr a year ago
- fix(deps): update module github.com/go-git/go-git/v5 to v5.8.1 (#578) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-git/go-git/v5](h... — committed to zydou/tea by deleted user 10 months ago
- plumbing: fix empty uploadpack request error If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.co... — committed to aymanbagabas/go-git by aymanbagabas 7 months ago
- plumbing: fix empty uploadpack request error If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.co... — committed to aymanbagabas/go-git by aymanbagabas 7 months ago
- plumbing: fix empty uploadpack request error If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.co... — committed to aymanbagabas/go-git by aymanbagabas 7 months ago
Yes, but limiting depth is super useful and I need it. If I don’t specify depth my program is way slower.
Same here with version
v5.5.1, downgrade tov5.3.0and it works@ydcool , @talwat , I am solving the issue by not specifying depth.
Still getting this error when going a clone with a depth specified, then running
git pullwithout depth onv5.9Same here.
@taigrr The version
v5.8.0was released last week and should contain the fix.I wasn’t specifying Depth on the Pull(), but was on the initial Clone() and get this error on any subsequent Pull().
If I remove specifying Depth on the Clone(), the Pull()s work fine.
This is not ideal for me since my service is useless until the initial clone is complete and making it shallower reduces that time. The repo I’m working with has a very long (and mostly irrelevant) history, so I was trying to limit that initial transfer. I just need the last couple weeks of changes at a given point in time.
The issue started with https://github.com/go-git/go-git/commit/320db9af8ba8b0046e833013504eb07c61a3573c
Works before
Fails afterwards:
Using Version
5.8.0Hey, I think there may still be an issue here. It appears that this fails if I don’t specify a
Depthin thePullfunction. If I run the command linegit pullwithin a shallow cloned directory, the pull succeeds.The reason this is valuable is that specifying
Depthwill cause thePullto fail if the the number of commits between the local HEAD and the remote HEAD is greater than the depth. This happens because git cannot determine that the fetched commits are descendants of the local branch. Command line git appears to pull enough commits to determine the ancestry, which was the behavior I was hoping would exist here. However, when I run without theDepthspecified, I run into the sameempty git-upload-pack givenerror.Let me know if I’m misunderstanding something.
The following script reproduces the issue by panic’ing on the error from
Pull:These changes did end up fixing the issue I was having in one of my repos.
Any chance we could get a new version tagged release so we can
go get -u?Thanks in advance, go-git team.
This issue is still persistent with
v5.6.1. Downgraded tov5.3.0which seems to work for now. Though, this is not ideal since the update path is blocked through this issue.Edit: Depth is not set in my case.
This issue has remained present and active for a while now, and the best solution I found is to just use os.Exec.