Error reading from database when viewing SCORM reports

Error reading from database when viewing SCORM reports

by Dax Nac -
Number of replies: 0

Hi,

Appreciate any help on this. We have Moodle 3.6.3+ (Build: 20190406) and have uploaded some Storyline 3 SCORM courses, which were working just fine testing before we went live. When the courses were pushed to the users, we probably got about thousands accessing the courses, estimated about 30,000 in a week, and probably about 600+ concurrent users daily accessing the courses.

Which wasn't really a problem other than a few feedback from users that it was slow at times and getting the moodle Alert "The  SCORM player has determined that your internet connection is unreliable...."

But when i started viewing reports for each course, i was getting the following error.Moodle Report error

Then i viewed the PHP error log and got this.

[18-Nov-2021 08:48:48 America/Los_Angeles] Default exception handler: Error reading from database Debug: SQLState: 42000<br>
Error Code: 8623<br>
Message: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.<br>

SELECT COUNT(DISTINCT(  CAST(u.id AS NVARCHAR(255))  +  CAST('#' AS NVARCHAR(255))  +  CAST(COALESCE(st.attempt, 0) AS NVARCHAR(255))  )) AS nbresults, COUNT(DISTINCT(  CAST(u.id AS NVARCHAR(255))  +  CAST('#' AS NVARCHAR(255))  +  CAST(st.attempt AS NVARCHAR(255))  )) AS nbattempts, COUNT(DISTINCT(u.id)) AS nbusers FROM mdl_user u LEFT JOIN mdl_scorm_scoes_track st ON st.userid = u.id AND st.scormid = 238 WHERE u.id IN ('....between here were multiple lines string or numbers, possibly IDs...')

Error code: dmlreadexception
* line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
* line 326 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
* line 433 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
* line 898 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
* line 974 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
* line 1571 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_records_sql()
* line 329 of \mod\scorm\report\basic\classes\report.php: call to moodle_database->get_record_sql()
* line 98 of \mod\scorm\report.php: call to scormreport_basic\report->display()

Any idea what could be the cause of this or if the PHP error related to the SCORM report error? Or related to the moodle Database not handling the traffic?

Thanks!


Average of ratings: -