# Git clone fails for large repos

**URL:** <https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864>\
**Category:** Gitea Usages\
**Created:** [February 26, 2025, 8:54am UTC](https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864 "2025-02-26T08:54:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [February 26, 2025, 8:54am UTC](https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864/1 "2025-02-26T08:54:02Z")

</div>

Hey folks,  
I’m running into an issue where cloning a large repo fails with:

```bash
git clone --progress --verbose https://gitea.mydomain.com/myorg/icinga2-bullshit.git
Cloning into 'icinga2-bullshit'...
POST git-upload-pack (175 bytes)
POST git-upload-pack (602 bytes)
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
fatal: expected 'packfile'

```

Here are some things I noticed while trying to debug this:

- the repo has about 4000 commits and 270MB size.
- the error occurs on windows and linux clients
- I managed to clone with the parameter `--depth=1` as workaround
- the Gitea server log shows while trying to clone the full repo:

```log
2025/02/26 08:46:12 ...eb/routing/logger.go:68:func1() [W] router: slow POST /myorg/icinga2-bullshit.git/git-upload-pack for 10.0.0.3:0, elapsed 3429.8ms @ repo/githttp.go:478(repo.ServiceUploadPack)
2025/02/26 08:47:02 ...eb/routing/logger.go:68:func1() [W] router: slow POST /myorg/icinga2-bullshit.git/git-upload-pack for 10.0.0.3:0, elapsed 3375.3ms @ repo/githttp.go:478(repo.ServiceUploadPack)

```

Gitea also spawns this process while the clone hangs:

```auto
/usr/bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= upload-pack --stateless-rpc /data/git/repositories/myorg/icinga2-bullshit.git

```

The clone command stops always after 100 seconds:

```bash
time git clone --progress --verbose https://gitea.mydomain.com/myorg/icinga2-bullshit.git
Cloning into 'foobar'...
POST git-upload-pack (175 bytes)
POST git-upload-pack (602 bytes)
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
fatal: expected 'packfile'

real 1m40.839s

```

Could this issue be related to a timeout on the Gitea server or the git client?

I’m really stuck here and would be happy for any advice / help 🙂

---

<div class="post-metadata">

**Author:** ![mlebon](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mlebon](https://forum.gitea.com/u/mlebon)\
**Post date:** [February 27, 2025, 10:55am UTC](https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864/2 "2025-02-27T10:55:35Z")

</div>

Hello OCram85,

I encountered something similar.

The problem came from the connection time that expired.

I modified in the app.ini file the connection duration.

I will edit the message if I find the parameter.

---

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [February 27, 2025, 11:29am UTC](https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864/3 "2025-02-27T11:29:45Z")

</div>

Do mean one of these settings: [Configuration Cheat Sheet | Gitea Documentation](https://docs.gitea.com/administration/config-cheat-sheet#git---timeout-settings-gittimeout) ?

I didn’t expect them to cause the problem because none of these values are near 100 → And the problem happens always at 1m40sec.

---

<div class="post-metadata">

**Author:** ![mlebon](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mlebon](https://forum.gitea.com/u/mlebon)\
**Post date:** [February 27, 2025, 1:48pm UTC](https://forum.gitea.com/t/git-clone-fails-for-large-repos/10864/4 "2025-02-27T13:48:14Z")

</div>

These are indeed the parameters  
and I had also modified these fields in LFS

;; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.  
LFS\_HTTP\_AUTH\_EXPIRY = 24h  
;;  
;; Maximum allowed LFS file size in bytes (Set to 0 for no limit).  
LFS\_MAX\_FILE\_SIZE = 0
