SSL_ERROR_SYSCALL, errno 104 while fetching (not pushing) git repository

Hello. I have an issue in the CI pipeline:

Initialized empty Git repository in /builds/core/mono/.git/
Fetching changes...
Created fresh repository.
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
ERROR: Job failed: command terminated with exit code 1

This happens from time to time, not always, but has been happening much more often lately. I’ve looked it up on the internet and everyone is talking about the postBuffer settings, which I’ve added under script for the respective stage:

.template: &service
  stage: build
    - git config --global http.postBuffer 524288000 # 500 MB

But this doesn’t work. And I’m not even sure it actually affects that stage where gitlab creates the new repository and fetching changes, which I assume is something that is being executed before whatever you write in the CI pipeline. Any ideas how I could solve this?

I’m running version v16.3.4-ee
I’m running gitlab-runner 11.11.2 in kubernetes as pods (I know, it’s old)

The repository size is about 835M.