Moodle 3.4 upload of 3.2G SCORM file results in generic server error

Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -
Number of replies: 14

All,

   I upgraded my test system to Moodle 3.4. I have enabled the PHP settings to allow for larger file upload sizes. This is a SCORM file. It goes to the end of the upload and then seems to stop and gives the "Error connecting to server" message. I have debugging turned on and do not see any other errors. Where do I look to start to debug this issue?

Sincerely,

Peter

Average of ratings: -
In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I know it's not very likely these days but first check your server is 64Bit. 32Bit installs have a file size limit of 2GB.

Next, switch on Debugging, reproduce the error, and check your web server's error log. Hopefully, something that will help pinpoint the problem will have been logged. 

In reply to Howard Miller

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Dear Howard,

   Thank you for your reply. I have turned debugging on. I am able to load a 2.5G file without error. We are running on a Microsoft virtual server connecting to an SQL Server database. What directory are the error logs I should review stored in?

Peter

In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Dear Howard,

    Would you tell me the location of the log files?

Peter

In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Go to Site administration > Server > PHP Info. Search for the 'error_log' setting. This shows you the location of PHP log output. 

In reply to Howard Miller

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Hi Howard,

   Thanks for that information. The only ting I see in the file is the following:


[04-Jan-2018 14:32:59 UTC] PHP Warning:  Module 'ldap' already loaded in Unknown on line 0


Not sure what it indicates.


Peter


In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Peter,
are you using IIS or Apache as web server? Are you using PHP 7.0+?

HTH,
Matteo

In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Peter,
could you share what are the changes you've made on your PHP settings?
I'd like to see both the numbers and the parameters involved in your change.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Hello,

    Thank you for your help. We are using IIS – Version 7.5.7600.16385 and PHP – Version 7.1. I have attached our php.ini file per your request. I appreciate any assistant you can provide.

Sincerely,

Peter

In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Peter,
TNX for the info, I was looking for:

post_max_size = 0
upload_max_filesize = 102400M

since post_max_size should be at least 30% greater than upload_max_filesize. Here, we're fine.

PHP 7.1 actually supports 64 bit integers in Windows, so guessing an issue w/ IIS configuration or other settings:

  1. [PHP] Look for the Activity Timeout setting in FastCGI and align it with max_execution_time and keep them greater than the time spent for the current upload, at least twice the time spent now w/ the broken upload
  2. [IIS] At Website level (Limits) align Connection Time-Out with the settings above, including the CGI timeout. Double check a Request Filtering setting, maximum allowed content length (maxAllowedContentLength): keep it aligned with the settings above - If this will be the main issue, you should look for 404.13 in your web server logs

BTW you could use a File System repository to avoid uploading files via HTTP (it will requires another way to upload files in the folder mapped into that repository, e.g. a UNC trusted path since you're on Windows) e.g. https://moodle.org/mod/forum/discuss.php?d=363474#p1465950 .

Edit: you should not rely on wincache (php_wincache.dll) but stick w/ opcache since Moodle supports only opcache.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Hello,

   We made the suggested changes and rebooted the server. We still get the generic upload error message. We transferred the file to the Moodle server (Windows 2008 R2). We then attempted to load the file from the Moodle server's file system and we get the error on the attached image. 

Attachment pic1.png
In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Peter,
the (in)famous SyntaxError popup means that the supposed JSON reply is broken i.e. is not a valid JSON probably due to some chars representing the HTML/text error we're searching for.
Open the browser Dev Tools using <F12> and then go to the Network pane, replicate the steps and then inspect all the rows w/ type xhr selecting one by one and look for its response body in the related Response tab.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Good Day Friends!

   I have taken your advice and have been tweaking the PHP file. Now when I try the upload I get the following error:

[09-Jan-2018 06:45:04 America/Tegucigalpa] PHP Warning:  sqlsrv_free_stmt(): supplied resource is not a valid ss_sqlsrv_stmt resource in C:\inetpub\wwwroot\moodle\lib\dml\sqlsrv_native_moodle_recordset.php on line 135

We are using SQL Server as our database.

Does this get us any further?

Peter


In reply to Peter Koel

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Peter,
I do not use MSSQL but for DEV purposes in Moodle: it looks like a timing issue with the underling connection closing before the code could do its job. It should not be a big issue unless it is the root cause for the JSON Syntax Error.

Are you still unable to upload that huge file?

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Moodle 3.4 upload of 3.2G SCORM file results in generic server error

by Peter Koel -

Hello,

   No, I am still not able to upload the file. I still get the generic error. No errors in the PHP error logs. To me, it appears to be a timing issue, as the upload starts and the progress bar continue to move across the screen. At the very end it just stops with the error.

Peter