Unable to push to repo due to `RPC failed; HTTP 413 error`

Recently it became impossible to push updates to our Gitea-hosted repo. We receive an error (shown below) that I do not know how to solve. A potential solution is to configure an SSH+GIT options, but this would require changes to our Kubernetes ingress rules that I’m not sure I can actually make (we are running Gitea as a Kubernetes deployment). I was able to push the updates to another copy of this repository on the host machine via ssh, but if I can’t push to the Gitea-controlled repo there is not much use to us for Gitea. Any help would be appreciated.

Pushing to https://example.com/repo.git
Enumerating objects: 139, done.
Counting objects: 100% (139/139), done.
Delta compression using up to 12 threads
Compressing objects: 100% (106/106), done.
Writing objects: 100% (124/124), 5.71 MiB | 149.90 MiB/s, done.
Total 124 (delta 24), reused 116 (delta 16)
POST git-receive-pack (5986730 bytes)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

It’s obviously, The request files are too large. Have you use a reverse proxy? If that, please check you have set a suitable post size limitation.

Now that you mention it, the Kubernetes ingress controller in front of the Gitea instance probably has configuration options to change the post size limits. Thanks for the idea.

This looks promising

Custom max body size

For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter client_max_body_size .

To configure this setting globally for all Ingress rules, the proxy-body-size value may be set in the NGINX ConfigMap. To use custom values in an Ingress rule define these annotation:

nginx.ingress.kubernetes.io/proxy-body-size: 8m