0

I migrated a django app from Openshift 2 to Openshift3 Online. It has an upload feature that allows users to upload audio files. The files are usually larger than 50MB. In Openshift3 if I try to upload the file it only works for files up to around 12 MB. Larger than 12 MB leads to an error message in the firefox saying "connection canceled". Chromium gives more details:

Request Entity Too Large
The requested resource
/myApp/upload
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

I'm using wsgi_mod-express. From searching on this error message on google, I could see that it I'm probably hitting any limit in the webserver configuration. Which limit could that be and how would I be able to change it?

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
user3620060
  • 131
  • 1
  • 14

1 Answers1

1

As per help messages from running mod_wsgi-express start-server --help:

--limit-request-body NUMBER
                    The maximum number of bytes which are allowed in a
                    request body. Defaults to 10485760 (10MB).

Change your app.sh to add the option and set it to a larger value.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • Thank you. Now I can upload up to 30 MB; but when I try a file above that (I tried 50MB file) it gives me the same error again. Is there any other limit to be checked? – user3620060 Jan 08 '18 at 00:25
  • What does the error message from the pod logs show? Does it really return a HTTP 413 error response to the client. How long does it take to upload your file? You might instead be hitting a timeout on how long the request is allowed to take. – Graham Dumpleton Jan 08 '18 at 00:42
  • Ok, that's embarrassing now: I missed one 0 when specifying the limit in Bytes. So instead of 300MB, I set the limit to 30MB. Sorry, but it was quite late yesterday... :-) It's working now. Thank you very much. – user3620060 Jan 08 '18 at 20:04
  • Is there a way to remove the limit altogether i.e. set to infinity? – DerFaizio May 15 '19 at 15:21
  • It is setting ``LimitRequestBody`` directive of Apache. See https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody for details. IOW, use ``0``. – Graham Dumpleton May 15 '19 at 21:17