Upload file limit

Gogs version: 0.11.29.0727
System: Linux Ubuntu 16.04
Database: SQLite3

I am trying to upload some files into my repository. They are about 50 MBs each. Gogs doesn’t let me upload anything larger than 3 MBs through the browser. However when committing changes and trying pushing I get the following error:
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: The remote end hung up unexpectedly
Then I tried using http://try.gogs.io in which I managed adding my file with no errors. Where is the limit set and how can I change it? I am using gogs’ docker image if that makes any difference. Thanks!

Update:
After studying the settings file a bit, I noticed I need to add some sections to my app.ini in gogs/data/conf. So these are the sections I added:

[attachment]
MAX_SIZE = 50

[release.attachment]
MAX_SIZE = 50

[repository.upload]
MAX_SIZE = 50

Unfortunately though, even after restarting the container, none of the messages I was getting changed. Still 3 MBs for Upload File and 32 MBs for files in releases. Can anyone point me out what’s wrong soon?

Are you running gogs behind a proxy (e.g. nginx)?
If yes, you need to raise the limit there as well.

Beside that, a max_size of 50 is probably not enough to fit 50mb files in it, try changing it to 60 or 100 even.

I’ve tried numbers as high as 1000, but the limit displayed inside gogs website itself never changed from 3…

Maybe stupid question, but did you restart gogs after changing app.ini?

Yes, I said that on my second message in this post…

I got pushing working by extending the limit in nginx, thanks for that. But the website still doesn’t let me upload anything larger than 32 MBs in releases… My app build is 60 MBs, I really need to put that there!

Did you ever get an answer? on this I have the same issue my config is set like this:

[repository.upload]
; Enable repository file uploads.
ENABLED = true
; Path to temporarily store uploads (default path gets cleaned by Gogs in every start)
TEMP_PATH = data
MAX_SIZE = 300
[attachment]
MAX_SIZE = 300

[release.attachment]
MAX_SIZE = 300

I have done a gogs web restart and a full sudo reboot nothing changes the limit from 3 mb

any help would be appreciated

Hi,

i had the same issue.

You have to set FILE_MAX_SIZE instead of MAX_SIZE in [repository.upload] like this:

[repository.upload]
FILE_MAX_SIZE = 300

Worked for me :slight_smile:

FYI, after fiddling with the size limits in the app.ini, I was still getting the error:

error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: the remote end hung up unexpectedly

I’m using nginx and looking around, I saw an issue for nginx-proxy (issue #39) with an answer that said:

add
client_max_body_size 500M ;
in
server {
https://github.com/jancelin/nginx-proxy/blob/master/nginx.tmpl

Adding the client_max_body_size 500M; limit to nginx I was able to upload the commits I had pending.

For other that have set the size limits in the Gogs app.ini file and still having it fail, it might be worth checking the web server file upload limits and increasing them.

1 Like