i have a problem with cloning/pulling some of GIT repositories. Most of repositories work correctly, but biggest one (commit count - we convert our two years old tfs project to GIT repositories) dont work.
Clone error:
git -c filter.lfs.smudge= -c filter.lfs.required=false -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks clone --branch master PROJECTPATHPLACEHOLDER.git C:\Workspace\GIT\PROJECTNAME Cloning into 'C:\Workspace\GIT\PROJECTNAME'... error: RPC failed; curl 56 Recv failure: Connection was reset fatal: error reading section header 'shallow-info'
Pull error:
RPC failed; curl 56 Recv failure: Connection was reset Git failed with a fatal error. error reading section header 'acknowledgments'
I try google possible solution, but none helped (increase http.postbuffer, different versions).
I tried diferent version of the GIT (2.21,2.27,2.29), different environment for git (GIT cmd, Microsoft Visual Studio Professional 2019 Version 16.8.0, Sourcetree 3.3.9) with same error output.
We using BitBucket server as a git server.
My configuration is laptop, win10 pro, remote over vpn.
I will be glad for any a help. Thanks, Lukáš Vašek
Ps. If there is any ambiguity, ask me for specification.
Considering anything related to shallow info comes from Git 2.18, Q2 2019 (commit 685fbd32916f3e94bc89aa14e8fdce835b06f801), maybe an older Git would ignore that header section entirely.
If not, I would first check if that repository can be cloned in any other environment (meaning on a Linux machine, still accessed through VPN, but local to the company network)
Note this error message can disappear with Git 2.37 (Q3 2022) in some cases:
"git fetch
"(man) unnecessarily failed when an unexpected optional section appeared in the output, which has been corrected with Git 2.37 (Q3 2022).
See commit 7709acf (16 May 2022) by Jonathan Tan (jhowtan
).
(Merged by Junio C Hamano -- gitster
-- in commit 9cf4e0c, 25 May 2022)
fetch-pack
: make unexpected peek result non-fatalSigned-off-by: Jonathan Tan
When a Git server responds to a fetch request, it may send optional sections before the packfile section.
To handle this, the Git client callspacket_reader_peek()
(seeprocess_section_header()
) in order to see what's next without consuming the line.However, as implemented, Git errors out whenever what's peeked is not an ordinary line.
This is not only unexpected (here, we only need to know whether the upcoming line is the section header we want) but causes errors to include the name of a section header that is irrelevant to the cause of the error.For example, at
$DAYJOB
, we have seen "fatal: error reading section header 'shallow-info'
" error messages when none of the repositories involved are shallow.Therefore, fix this so that the peek returns 1 if the upcoming line is the wanted section header and nothing else.
Because of this change,reader->line
may now beNULL
later in the function, so update the error message printing code accordingly (expected '%s', received '%s'
orexpected '%s'
).