go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.02k stars 5.31k forks source link

Push failed on some repos #22220

Open piperoc opened 1 year ago

piperoc commented 1 year ago

Description

I recently deployed a Gitea server on a self hosted Ubuntu 22.04 server.

Everything has been working great, until I created a new repo (C++ code) yesterday and have been trying to push changes since -- without any success.

Every time I try a push I get these errors in my git client log:

[11:56:46] Push main: started.
[11:57:19] Push main: Failed to write chunk header for origin: this might indicate a file is too large.
[11:57:19] Push main: finished with errors.
[15:22:47] Fetch remote origin: failed to send request: The operation timed out

I can't find any large files, although I'm trying to push ~1000 files (should not be a concern anyway).

Here's a relevant excerpt of my app.ini (I am not starting the ssh server, since I did not want to configure it).

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   = xxxxxxxxxxxxx
SCHEMA   =
SSL_MODE = disable
CHARSET  = utf8
PATH     = /var/lib/gitea/data/gitea.db
LOG_SQL  = false

[repository]
ROOT = /var/lib/gitea/data/gitea-repositories

[server]
SSH_DOMAIN       = xxxxxxxxxxxx.com
DOMAIN           = xxxxxxxxxxxx.com
HTTP_PORT        = 3000
ROOT_URL         = https://xxxxxxxxxxxxxxx.com/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_JWT_SECRET   = xxxxA2kxxxxxlUDLDxxxxxIxxxxxxx
OFFLINE_MODE     = false

[lfs]
PATH = /var/lib/gitea/data/lfs

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04 Jammy (server)

How are you running Gitea?

I used your download and the instructions on how to install on Ubuntu.

Database

MySQL

piperoc commented 1 year ago

Clearly it's a commit size issue. I reduced the amount of files to commit/push and eventually succeeded. But in most situations (especially at the beginning of the project), it's likely that one would add many files and dependencies at once. It would be nice to know if there is a way to manage that.

I looked around (StackOverflow, etc.) found some information but nothing definitive other than you should use SSH instead, which is not always an option.

Thanks for any info on this.

lunny commented 1 year ago

Maybe you could change the timeout on app.ini [git.timeout] and have a try again.

piperoc commented 1 year ago

Thank you @lunny .

I changed it and will see how it works.

For people who need to change the git.timeout parameters (the cheat sheet wasn't too clear to me) here's an excerpt of the section I edited on my app.ini:

...
[service]
REGISTER_EMAIL_CONFIRM            = true
ENABLE_NOTIFY_MAIL                = true
DISABLE_REGISTRATION              = true
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.localhost

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[git.timeout]
DEFAULT = 600
MIGRATE = 960
MIRROR = 600
CLONE = 600
PULL = 600
GC = 120
...
lunny commented 11 months ago

Did it work later?

piperoc commented 11 months ago

@lunny unfortunately it did not. I ended up avoiding large commits for a while. Eventually, I stopped using it so I did not try anything further.