Default exception handler: Can not find data record in database table course.

Default exception handler: Can not find data record in database table course.

by Paul Lindgreen -
Number of replies: 1
Picture of Particularly helpful Moodlers

The following 2 php error messages below occurred many times during a moodle outage a few days ago (Moodle was unresponsive, IIS restart required to fix it), I've included the IIS log entry for the same moment too.

It looks like some data integrity problems for a course resource? Can anyone shed any light or suggest something I can do to further investigate the problem?

thx,

=========error logs==============
php error logs:
[20-Sep-2013 15:03:06 UTC] Default exception handler: Can not find data record in database table course. Debug: SELECT * FROM {course} WHERE id = ? [array ( 0 => 21, )] Error code: invalidrecord * line 1357 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown * line 1333 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select() *line 66 of \file.php: call to moodle_database->get_record()

[20-Sep-2013 15:16:48 UTC] Default exception handler: Sorry, the requested file could not be found Debug: Error code: filenotfound * line 476 of \lib\setuplib.php: moodle_exception thrown * line 1973 of \lib\filelib.php: call to print_error() * line 4313 of \lib\filelib.php: call to send_file_not_found() * line 38 of \pluginfile.php: call to file_pluginfile()

IIS logs references the following at the same time:
2013-09-20 15:03:06 W3SVC1 140.230.5.163 GET /m23/mod/resource/view.php id=28568 80 - 96.30.141.242 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.66+Safari/537.36 200 0 0 24013 911 421

======my environment==========
My environment is Moodle 2.4.5 Windows 2008 server, IIS 7.5 , php 5.3.16, 14gb Memory, 4 cpu Mysql1 on seperate server, same specs as above: Mysql server 5.1, windows 2008 64 bit Zend Extension Build API220090626,NTS,VC9 PHP Extension Build API20090626,NTS,VC9 Thread Safety disabled System Windows NT MOODLE2TEST 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 Build Date Aug 15 2012 19:57:50 Compiler MSVC9 (Visual C++ 2008) Architecture x86

Average of ratings: -
In reply to Paul Lindgreen

Re: Default exception handler: Can not find data record in database table course.

by Paul Lindgreen -
Picture of Particularly helpful Moodlers

I see a proposed fix here that runs a course cache rebuild: https://tracker.moodle.org/browse/MDL-36789

All thats required are the course id's with the corrupt data. Does anyone know of a query to find courses with the corrupt data so I can apply the fix above to them?