Morkg's picture

Hi,

   I'm trying to find out where can i increase the file size so when im uploading a 3GB file it tells me that max file size is 2048Mib how can i increase the file size,

 

Here is what i have done:

 1 - looked under setup in settings and i couldnt find the value

 2- updated the nginx file /etc/nginx/nginx.conf and mayan in sites available (didnt work)

3- rebooted the appliance multiple times and did a supervisorctl restart all after each change with no luck

Thank you

Forum: 
Tags: 
Jeremy Davis's picture

If you look at the Mayan-EDMS specific Nginx config (/etc/nginx/sites-available/mayan) you should see this:

# redirect http to https
server {
    listen 0.0.0.0:80;
    return 302 https://$host$request_uri;
}

# reverse proxy for Mayan-EDMS
server {
    listen 0.0.0.0:443 ssl;
    access_log /var/log/nginx/mayan.log;
    error_log /var/log/nginx/mayan_error.log;
    include /etc/nginx/include/ssl;
    client_max_body_size 50M;  # Increase to upload bigger documents

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass_header Set-Cookie;

        proxy_pass http://127.0.0.1:8000/;
        proxy_redirect off;
        proxy_read_timeout 30s; # Increase if your doc uploads take more than 30 sec
    }
}

As per the comments, you'll want to bump 'client_max_body_size' and possibly 'proxy_read_timeout' too.

Then to apply the changes, restart Nginx:

systemctl restart nginix

Hopefully you should now be good to go! :)

Morkg's picture

Hi i forgot to mention that, this step did not work, its on the webapplication it self it has a set value of 2048 and i cant find where to update that value.

 

attached is what i have in the mayan ngnix file.

 


# redirect http to https
server {
    listen 0.0.0.0:80;
    return 302 https://$host$request_uri;
}

# reverse proxy for Mayan-EDMS
server {
    listen 0.0.0.0:443 ssl;
    access_log /var/log/nginx/mayan.log;
    error_log /var/log/nginx/mayan_error.log;
    include /etc/nginx/include/ssl;
    client_max_body_size 6048M;  # Increase to upload bigger documents

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass_header Set-Cookie;

        proxy_pass http://127.0.0.1:8000/;
        proxy_redirect off;
        proxy_read_timeout 300s; # Increase if your doc uploads take more than 30 sec
    }
}

 

Thank you

Morkg's picture

After debugging the Application, it seems the application uses a react js that controls the uploading, this file is set for 1024 * 1024 file size which is 2048 M max, change that and it should work,

 

thank you for the help

Jeremy Davis's picture

Awesome to hear that you worked it out!

Could you please share where/how you changed it so that we can ensure it's adequately documented?!

Morkg's picture

Hi,

 ops i forgot to list the name of the file, dropzone.js you will need to update the gz file

/opt/mayan-edms/media/static/sources/node_modules/dropzone/dist/dropzone.js.gz the static file,

 

so after i updated that file i can upload the 3.2 GB but its not fully uploading the file i get a 502 gateway error after it says it done uploading.

do you know what might be causing that error ?

 

 

Jeremy Davis's picture

Thanks for that! I'll be sure to document that somewhere.

A 502 is most often caused by a server side crash. My guess is that the Nginx, Supervisor or Mayan logs might help troubleshoot that. The Niginx logs should be in /var/log/nginx. I'm not sure about Supervisord and as per another recent thread (sorry I forget if that was you or not) the Mayan logs appear to be within /opt/mayan-edms - but I forget where exactly; perhaps try a search like this:

find /opt/mayan-edms -type f -name "*.log"

Please feel free to post here if you want me to help out (or attach to your original post - files can only be attached to the first post of each thread).

One edge case possibility that occurs is that perhaps it's hitting the Nginx limits now? I know that you've already bumped the timeout to 5 minutes and upload to 6GB, so it seems unlikely, but it's the only thing that occurs to me.

It's possible that the 502 issue is outside of Mayan itself, but another possiblity for assistance is to post in the Mayan forums. If you do that, please post a link to your thread here and/or cross post info here.

Morkg's picture

Hi Thanks for the help in advance

  after looking through the error logs, found in mayan_error.log file, this error

10 sendfile() failed (32: Broken pipe) while sending request to upstream

im googling around to see what is causing this issue if you have an idea please post :)

 

thank you

Mork G

Jeremy Davis's picture

I suggest asking on the Mayan forums as I'm not at all sure about that.

Also apologies for not including the link in my previous post (I alluded to it, but didn't post it) and for such a slow reply...

Regardless, if you post on Mayan's forums, please cross post a link to your post on there forums. If you need/want any further input from me, please ask. I don';t have any knowledge of this specific issue, but I do know a fair bit about how Mayan is set up in our appliance (I did a lot of the work myself) and I know lots about TurnKey in general (as you'd probably expect...).

Add new comment