I tried to play around with this a bit more:
1. bumped sshExpirationSeconds to 6000, didn't help
Verified timeout has been bumped using
ssh gerrit git-lfs-authenticate repo download # And then checking the expires values
git-lfs/3.1.4 (GitHub; linux amd64; go 1.18.1)
2. Copied the repo to a normal linux user on the gerrit server manually (archive + scp), and then pushed from there (to take the network out of the picture)
That worked, however the server has an older version of git lfs
git-lfs/2.7.1 (GitHub; linux amd64; go 1.11.6)
3. Tried it from another server (same datacenter), that worked too.
git-lfs/2.13.1 (GitHub; linux amd64; go 1.14)
4. Tried using the same versions locally, compiling from tags
git-lfs/2.7.1 wouldn't run
git-lfs/2.13.1 worked locally once but not reliably
I've also noticed that it always fail when uploading the last (or last few) LFS objects, which are the biggest size wise (~50MB or more)
Smaller objects get uploaded fine, so it might be hitting a timeout somewhere.