appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.26k stars 3.71k forks source link

[Bug]: Not able to upload files greater than 75 mb #14293

Closed ajinkyakulkarni closed 11 months ago

ajinkyakulkarni commented 2 years ago

Is there an existing issue for this?

Description

A user on discord mentioned that he/she is not able to upload a file great than 65MB

https://discord.com/channels/725602949748752515/760761686549463060/981196657653866516

I was able to reproduce this, when a file of 95MB was uploaded

error1

Upon more investigation, it was found thatclient_max_body_size is correctly set in nginx

error2

But, it was observed that the incorrect content-length is being sent in the header. For example, for a file of size 78mb, the sent content-length header was 104mb. For a file of size 68mb, the sent content-length header was 90mb.

error3

So, because of this, users are not able to upload files of 100mb even if that is what we say is allowed.

Steps To Reproduce

  1. Upload the file of size say 80mb
  2. Observe that the content-length header is greater than 100mb.

Public Sample App

No response

Version

Cloud

ajinkyakulkarni commented 2 years ago

To temporarily get unblocked, I could verify this approach

Login to the docker container

  1. Open the file /etc/nginx/conf.d/app.conf
  2. Change client_max_body_size to 200m
  3. Restart the nginx /usr/sbin/nginx -s reload
  4. Verify the change /usr/sbin/nginx -T
image

Here is the complete verification of this approach

image
ajinkyakulkarni commented 2 years ago

Related https://github.com/appsmithorg/appsmith/issues/14248

ajinkyakulkarni commented 2 years ago

Some more investigation

Then I uploaded a file of 100mb and I got the following Java OutOfMemory error

image

Then temporarily increased the Java Heap Size and restarted the supervisor

cd /opt/appsmith
export APPSMITH_JAVA_HEAP_ARG="-Xmx512m"
./update-and-restart-supervisor.sh

Now, when I try to upload files, the backend server shows the the actions are getting executing without the Java OutOfMemory error

image
ajinkyakulkarni commented 2 years ago

I am able to reproduce an error where backend restarts mentioned by the user https://discord.com/channels/725602949748752515/981196657653866516

On client I see 502 Bad Gateway error

image
ajinkyakulkarni commented 2 years ago

I confirmed that Java Backend Server crashes even when launched outside of supervisord

image

https://user-images.githubusercontent.com/800578/173202763-74a99ed1-cdf7-4c89-b11a-99deb2169209.mp4