{"thread":{"id":"55493","subject":"possible race condition (fetch-pack: unexpected disconnect while reading sideband packet)","startedAt":"2021-04-14T10:27:50Z","lastAt":"2021-04-16T00:04:14Z","messageCount":3,"participants":["Simon, Martin (Digiteq Automotive)","Jeff King","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"421961","messageId":"df13300936784af7bb6c23f9fe0465c9@digiteqautomotive.com","threadId":"55493","inReplyTo":null,"subject":"possible race condition (fetch-pack: unexpected disconnect while reading sideband packet)","fromName":"Simon, Martin (Digiteq Automotive)","fromEmail":"martin.simon@digiteqautomotive.com","sentAt":"2021-04-14T10:12:44Z","receivedAt":"2021-04-14T10:27:50Z","isPatch":false,"sender":{"key":"martin.simon@digiteqautomotive.com","avatar":null},"body":"Hello,\n\nI'd like to report a bug, if it's not already known, but I wasn't able to find it on https://lore.kernel.org/git/.\n\nSetup:\nWe use Git for Windows in version 2.31.0 on MS Windows Server 2019, to access repository on Gitlab 13.10. Both machines are virtual under different physical machines, but still in the same server room connected with high speed network to each other.\n\nReproducibility:\nrandom (like 50:50)\n\nReproducer:\nTry to clone (initial clone, or initial init && fetch, doesn't matter) a repo from the gitlab to the machine\n\nExpected results:\nRepository cloned/fetched successfully\n\n\nActual result (when failed):\nCloning into 'local-repo-name'...\nremote: Enumerating objects: 237, done.\nremote: Counting objects: 100% (237/237), done.\nremote: Compressing objects: 100% (129/129), done.\nfetch-pack: unexpected disconnect while reading sideband packet\nfatal: early EOF\nfatal: fetch-pack: invalid index-pack output\n\nNotes:\nSome repositories are almost always successful (doesn't matter if they are bigger or smaller), clone and init+fetch seem to behave similarly (from the perspective of the issue). From any machine on the same network, but e.g. through several network routers or VPN, the issue was never observed.\nOur current git config:\nC:\\Users\\username>git config --list\ndiff.astextplain.textconv=astextplain\nfilter.lfs.clean=git-lfs clean -- %f\nfilter.lfs.smudge=git-lfs smudge -- %f\nfilter.lfs.process=git-lfs filter-process\nfilter.lfs.required=true\nhttp.sslbackend=schannel\ncore.autocrlf=true\ncore.fscache=true\ncore.symlinks=false\ncore.editor=notepad\npull.rebase=false\ncredential.helper=manager-core\ncredential.https://dev.azure.com.usehttppath=true\ninit.defaultbranch=master\nhttp.postbuffer=512000000*\ncore.compression=9*\ncore.packedgitlimit=512m*\ncore.packedgitwindowsize=512m*\npack.deltacachesize=2047m*\npack.packsizelimit=2047m*\npack.windowmemory=2047m*\nsendpack.sideband=false*\n\nThese marked with asterisk(*) were added to localize this issue, without any observable effect.\n\nI'm willing to provide more information or even contribute on the fix, just let me know what should I do/try. Thank you.\n\nBest Regards,\nMartin Simon\n"},{"id":"422005","messageId":"YHf5bkiE7SVPTBvU@coredump.intra.peff.net","threadId":"55493","inReplyTo":"df13300936784af7bb6c23f9fe0465c9@digiteqautomotive.com","subject":"Re: possible race condition (fetch-pack: unexpected disconnect while reading sideband packet)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-04-15T08:29:34Z","receivedAt":"2021-04-15T08:29:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 14, 2021 at 10:12:44AM +0000, Simon, Martin (Digiteq Automotive) wrote:\n\n> Actual result (when failed):\n> Cloning into 'local-repo-name'...\n> remote: Enumerating objects: 237, done.\n> remote: Counting objects: 100% (237/237), done.\n> remote: Compressing objects: 100% (129/129), done.\n> fetch-pack: unexpected disconnect while reading sideband packet\n> fatal: early EOF\n> fatal: fetch-pack: invalid index-pack output\n\nThis could be many things. A bug or race on the client side is possible,\nbut it could also be that the network session really _is_ being\ndisconnected. This could be something in the network stack itself\nterminating the connection, or it could be a bug or other error on the\nserver.\n\nSome things to consider/try:\n\n  - you can run with GIT_TRACE_PACKET=1 set in the environment, which\n    will dump the protocol messages that Git sees (this may not be\n    enlightening since the problem case seems to be a hangup, but\n    perhaps the moment it happens will be relevant)\n\n  - you didn't say which protocol you're using. If it's http, try\n    setting GIT_TRACE_CURL, too, and it will dump debugging data about\n    the http session\n\n  - if possible, try a different protocol (like ssh) and see if the\n    problem continues to show up\n\n  - look at server-side logs to see how the server perceives the\n    sessions. Does it report any errors that might cause it to hang up?\n    Does it see a client-side hangup (which might be indicative of\n    something flaky in the network)?\n\n-Peff\n"},{"id":"422075","messageId":"YHjUd67KujPCl1U9@camp.crustytoothpaste.net","threadId":"55493","inReplyTo":"YHf5bkiE7SVPTBvU@coredump.intra.peff.net","subject":"Re: possible race condition (fetch-pack: unexpected disconnect while reading sideband packet)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-04-16T00:04:07Z","receivedAt":"2021-04-16T00:04:14Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-04-15 at 08:29:34, Jeff King wrote:\n> On Wed, Apr 14, 2021 at 10:12:44AM +0000, Simon, Martin (Digiteq Automotive) wrote:\n> \n> > Actual result (when failed):\n> > Cloning into 'local-repo-name'...\n> > remote: Enumerating objects: 237, done.\n> > remote: Counting objects: 100% (237/237), done.\n> > remote: Compressing objects: 100% (129/129), done.\n> > fetch-pack: unexpected disconnect while reading sideband packet\n> > fatal: early EOF\n> > fatal: fetch-pack: invalid index-pack output\n> \n> This could be many things. A bug or race on the client side is possible,\n> but it could also be that the network session really _is_ being\n> disconnected. This could be something in the network stack itself\n> terminating the connection, or it could be a bug or other error on the\n> server.\n\nI'll point out that this kind of occurrence also happens if folks are\nusing proxies or TLS middleboxes, as well as some antivirus and firewall\nprograms on Windows (which often end up being well-hidden proxies due to\ntheir configuration, unfortunately).  That usually only applies to\nHTTPS, so oftentimes switching to SSH, as Peff suggested, may be a good\nchoice.\n\nYou can also try running the operation under WSL 2, which generally is\nnot subject to most of those programs and mostly handles its own\nnetworking, to see if it is one of those programs or if there's a more\ngeneral network- or protocol-specific problem.  That will at least give\nyou more information about the nature of what's going on and help you\ntroubleshoot further.\n-- \nbrian m. carlson (he/him or they/them)\nHouston, Texas, US\n"}]}