Error code: dmlreadexception when running mySQL backup

Error code: dmlreadexception when running mySQL backup

by David O'Brien -
Number of replies: 2

Hello

I am getting a an error of:

Default exception handler: Error reading from database Debug: Table 'xxxxxx_moodle.mdl_tag_correlation' doesn't exist
SELECT pairs.tagid, pairs.correlation, pairs.ocurrences, co.id AS correlationid
              FROM (
                       SELECT ta.tagid, tb.tagid AS correlation, COUNT(*) AS ocurrences
                         FROM mdl_tag_instance ta
                         JOIN mdl_tag_instance tb ON (ta.itemtype = tb.itemtype AND ta.itemid = tb.itemid AND ta.tagid <> tb.tagid)
                     GROUP BY ta.tagid, tb.tagid
                       HAVING COUNT(*) > ?
                   ) pairs
         LEFT JOIN mdl_tag_correlation co ON co.tagid = pairs.tagid
          ORDER BY pairs.tagid ASC, pairs.ocurrences DESC, pairs.correlation ASC
[array (
  0 => 2,
)]
Error code: dmlreadexception
* line 423 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 942 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 918 of /tag/lib.php: call to mysqli_native_moodle_database->get_recordset_sql()
* line 1006 of /tag/lib.php: call to tag_compute_correlations()
* line 148 of /lib/cronlib.php: call to tag_cron()
* line 61 of /admin/cli/cron.php: call to cron_run()

Moodle 2.5.2+ (Build: 20130927)

when backing up mySQL via a cron. I can see that dmlreadexception is a general error but is the rest of the debug anything to worry to much about?

Many Thanks

 

Average of ratings: -
In reply to David O'Brien

Re: Error code: dmlreadexception when running mySQL backup

by Randy Thornton -
Picture of Documentation writers

I have a site with a similar issue: the mdl_tag_correlation table has mysteriously vanished.

Did you fix this by manually recreating the missing table?

 

 

In reply to Randy Thornton

Re: Error code: dmlreadexception when running mySQL backup

by Randy Thornton -
Picture of Documentation writers

 

We fixed this by recreating the table structure from a previous SQL dump.

However, I am concerned that we have no idea how this happened: the mgl_tag_correlation table existed, but the structure and all data were deleted, apparently internally to Moodle. This caused the cron which calculates this table to force the sql server to throw some errors.

Fortunately for us, this table is calculated and the other tag tables are empty anyway. But that a table was discarded through some process is worrisome.