plane icon indicating copy to clipboard operation
plane copied to clipboard

[bug] How to increase allowed attachment size? FILE_SIZE_LIMIT not working

Open Plorenzo opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current behavior

When a image bigger than 5MBs is uploaded the system give an error. File size too large. Please select a file smaller than 5MB. Screenshot 2024-01-17 at 20 15 17

To increase this limit, I tried to change FILE_SIZE_LIMIT to 15728640 in .env a restart the services, both with ./setup.sh script and directly docker compose up -f and after the services are up again the same error happens when trying to upload a big file.

Steps to reproduce

Create an issue an try to upload a 6MB file

Browser

Safari, also in Firefox

Version

Self-hosted

Plorenzo avatar Jan 17 '24 12:01 Plorenzo

@Plorenzo I had also to increase the Nginx max body size:

image

niltonvasques avatar Jan 23 '24 05:01 niltonvasques

I just check and the nginx config in the container is correctly updated already from the .env file

Plorenzo avatar Jan 24 '24 11:01 Plorenzo

@Plorenzo hope you have changed the .env file

mguptahub avatar Feb 06 '24 09:02 mguptahub

@mguptahub please refer to my original comment

... I tried to change FILE_SIZE_LIMIT to 15728640 in .env a restart the services ...

Plorenzo avatar Feb 06 '24 12:02 Plorenzo

I ran into this too. Good news, read through.

I have verified that setting FILE_SIZE_LIMIT and restarting updates the nginx.conf in the proxy container.

For example, mine looks like

...
        client_max_body_size 134217728;
...

When I upload a file that is 20 MB, it failed with a 413 Request Entity Too Large. But, it would not show up in the "proxy" container logs. Why is that?

Turns out, I had to update the outer nginx layer that reverse proxied towards the container, as the outer nginx layer handles HTTPS with certbot.

(host nginx) -> [docker nginx proxy container -> api container]
 ^^^^^^^^^^
Failure was in the host.

If you run into this, check every layer of your implementation!

cendyne avatar Jul 23 '24 00:07 cendyne