git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Partial clone - bad pack header?

From
Jeff King <peff@peff.net>
Date
Feb 4, 2019, 23:28 UTC
Message-ID
<20190204232844.GA2366@sigill.intra.peff.net>
In-Reply-To
<CAE5ih7-Gi6i8ZRDjsVELLesTORRDxvrLYf00DYTBRFUWUmAAdw@mail.gmail.com>
On Mon, Feb 04, 2019 at 01:45:35PM +0000, Luke Diamand wrote:
Show 17 quoted lines
> I tried to do a partial clone, but it gave me a "bad pack header". Is
> there anything I can do to debug this?
> 
> I did "git config uploadpack.allowfilter true" in my repo.
> Then I went to a scratch directory and did:
> $ git clone --filter=blob:limit=10M ssh://localhost/~/git/my_big_repo
> remote: Enumerating objects: 1619425, done.
> remote: Counting objects: 100% (1619425/1619425), done.
> remote: Compressing objects: 100% (362435/362435), done.
> remote: Total 1619425 (delta 1225623), reused 1604277 (delta 1211975)
> Receiving objects: 100% (1619425/1619425), 10.34 GiB | 35.61 MiB/s, done.
> Resolving deltas: 100% (1225623/1225623), done.
> Note: checking out 'a943f529b4781f34602f1ad5aab99a8699975c29'.
> [...]
> fatal: the remote end hung up unexpectedly
> fatal: protocol error: bad pack header
> warning: Clone succeeded, but checkout failed.

Just a guess, but does setting uploadpack.allowAnySHA1InWant to "true" in the source repo help?

By default, upload-pack will not allow the client to request those arbitrary blob sha1s. I thought it was _supposed_ to notice this and complain with a nice error message, but I know I have run into cases in the past where it does not (but never tracked it down -- this may well be one of them).

-Peff
Previous: Luke DiamandNext: Luke Diamand
Message 2 of 3 in “Partial clone - bad pack header?”
  1. Luke DiamandFeb 4, 2019
  2. Jeff KingFeb 4, 2019
  3. Luke DiamandFeb 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.