Can't upload Scorm file over 100M

Can't upload Scorm file over 100M

by Pato PM -
Number of replies: 7

Hi All,  


I'm using Moodle 2.8.7 and having trouble uploading scorm files over 100M, smaller files are accepted by moodle but over 100MB it just stops with a "Error connecting to the server" message after 2 attepts to upload when using the drag and drop mode. If using the file picker mode it uploads about 25 percent of the to start again  a few times and then just stays indefinetly in a loop showing the working circle icon.


I have set all user permissions to allow 500M uploads.


Searching for the error I found it to be the error branch of the following  code in lib/form/dndupload.js

    847             xhr.onreadystatechange = function() { // Process the server response

    848                 if (xhr.readyState == 4) {

    849                     if (xhr.status == 200) {

                              .....

    870                     } else {

    871                         self.print_msg(M.util.get_string('serverconnection', 'error'), 'error');

    872                         self.uploadfinished();

    873                     }


where  the 4 is  XMLHttpRequest.readState property "DONE" and 200 is HTTP 200 "OK"

Has anyone experienced a similar problem?


Regards,

Pato.

my settings:

1. /etc/httpd/conf/httpd.conf

    <IfModule mod_php5.c>

     php_value upload_max_filesize=500M

     php_value post_max_size=500M

    </IfModule>


    <VirtualHost *:80>

      ServerName dev.someplace.org

      ServerAdmin webmaster@someplace.org

      DocumentRoot /var/www/moodle

      ErrorDocument 503 /mantencion/index.html

      LimitRequestBody 524288000

  </VirtualHost>


2. /etc/php.ini

    ; Maximum execution time of each script, in seconds

   max_execution_time = 600


    ; Maximum size of POST data that PHP will accept.

    post_max_size = 500M

    ; Maximum allowed size for uploaded files.

     upload_max_filesize = 500M

References:

The XMLHttpRequest.readyState property returns the state an XMLHttpRequest client is in. An XHR client exists in one of the following states:

Value State Description

0 UNSENT Client has been created. open() not called yet.

1 OPENED open() has been called.

2 HEADERS_RECEIVED send() has been called, and headers and status are available.

3 LOADING Downloading; responseText holds partial data.

4 DONE The operation is complete.

source: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState


Average of ratings: -
In reply to Pato PM

Re: Can't upload Scorm file over 100M

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Have you restarted your server? That is the most likely possibility I would think. Stop all services and restart them, see what happens. 

In reply to Colin Fraser

Re: Can't upload Scorm file over 100M

by Pato PM -

Hi Colin, Thanks for your reply, but could you elaborate why you think restarting the server would help?

 I have restarted the apache service several times but that hasn´t changed  the described behaviour.

Regards.

Pato.

 

In reply to Pato PM

Re: Can't upload Scorm file over 100M

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Pato,

Do you by any chance have modsecurity installed on your server? It also has a couple of size limit settings in it which caused me problems when I first started using it. It took me a while to realize it was causing the problem as we had it installed for a couple of years before a student tried to upload something too big for it's default limits.

If you do have modsecurity, it is the three settings with Limit as the final part of the setting name.

In reply to AL Rachels

Re: Can't upload Scorm file over 100M

by Pato PM -

Hi Al, Thank you for your reply, I have  checked modsecurity and firewalls and found nothing. Then I checked with our housing provider to see if their firewall had something to do with it. They couldn´t trace my trafic to their  FW, after a little wondering and searching we traced that our ip was resolving to a Cloudflare service we had configured using a proxy provided by Cloudflare, wich was ultimately responsible for blocking http uploads over 100MB. So if we need to upload courses over 100MB we have to temporally switch off the proxy. It´s not a rocket science solution but it works for us. 

In reply to Pato PM

Re: Can't upload Scorm file over 100M

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Pato, if you have already restarted the server, then any change made to the httpd.config file are already activated, but it is a common error not to restart, believe it or not. 

As Al mentioned, there can be other security addins that have an effect. If the Server, the PHP settings and Moodle all agree, then there has to be something else, a throttle applied somewhere, by something not mentioned so far. Outside of that, I can't think of anything that may impact on uploads. 

The only other thing is it just SCORM files or all file types? A SCORM is usually a compressed file at upload, so is there some restriction on zipped files? 

In reply to Colin Fraser

Re: Can't upload Scorm file over 100M

by Pato PM -

Hi Colin Thank you for your reply,  I  rechecked the firewalls and found nothing. Then I checked with our housing provider to see if their firewall had something to do with it. They couldn´t trace my trafic to their  FW, after a little wondering and searching we traced that our ip was resolving to a Cloudflare service we had configured using a proxy provided by Cloudflare, wich was ultimately responsible for blocking http uploads over 100MB. So if we need to upload courses over 100MB we have to temporally switch off the proxy. It´s not a rocket science solution but it works for us. Thanks again for your input!

In reply to Pato PM

Re: Can't upload Scorm file over 100M

by Colin Fraser -
Picture of Documentation writers Picture of Testers

CloudFlare? AGAIN!!! I thought we had gotten around that... It was an issue a while back relating mainly to the new editor Atto, I think it was. Been quiet there ever since. Thanks for the heads up on this - valuable information.