The error that you may see if you are currently using Moodle may be seen after cron runs or when heavy access occurs. The error,
!!! Can not find data record in database table course_modules. !!!
The error is related to heavy transactions and what we believe is caching corrupting the database.
To fix the error, you can run this query:
select modinfo from mdl_course where id = PutYourCourseIDHere; Below, we use MySQL Workbench to run the query on a course id of 2
There is also a Moodle plugin that rebuilds all of the site’s cache.