Installation help

InnoDB Upgrade Issues (V2.4) dmlwriteexception

 
 
Picture of Constance Horne
InnoDB Upgrade Issues (V2.4) dmlwriteexception
 
I am on V2.4 of Moodle and am preparing to upgrade to v2.7.

I recently performed the InnoDB upgrade by using the built-in admin function using a browser. It looked like it worked fine and my site appears to be functioning. This is a dev site so there are no actual users except me on it right now.

I tried to go and print a certificate (add-on) and now I am getting some database write errors:

Error writing to database

More information about this error

Debug info: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
DELETE FROM mdl_files WHERE id = ?
[array (
0 => '2345',
)]
Error code: dmlwriteexception
Stack trace:
  • line 429 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1310 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1696 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->delete_records_select()
  • line 293 of /lib/filestorage/stored_file.php: call to moodle_database->delete_records()
  • line 623 of /lib/filestorage/file_storage.php: call to stored_file->delete()
  • line 585 of /mod/certificate/lib.php: call to file_storage->delete_area_files()
  • line 150 of /mod/certificate/view.php: call to certificate_save_pdf()
 
Average of ratings: -
Picture of jason everling
Re: InnoDB Upgrade Issues (V2.4) dmlwriteexception
Group Particularly helpful Moodlers

https://moodle.org/mod/forum/discuss.php?d=251971

You need to restart MySQL after making the above changes.


JASON

 
Average of ratings: -
Picture of Constance Horne
Re: InnoDB Upgrade Issues (V2.4) dmlwriteexception
 

Added statement (binlog_format=ROW) to my.ncf and rebooted. I am still getting the same errors:


Error writing to database

More information about this error

Debug info: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
DELETE FROM mdl_files WHERE id = ?
[array (
0 => '2345',
)]
Error code: dmlwriteexception
Stack trace:
  • line 429 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1310 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1696 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->delete_records_select()
  • line 293 of /lib/filestorage/stored_file.php: call to moodle_database->delete_records()
  • line 623 of /lib/filestorage/file_storage.php: call to stored_file->delete()
  • line 585 of /mod/certificate/lib.php: call to file_storage->delete_area_files()
  • line 150 of /mod/certificate/view.php: call to certificate_save_pdf()

 
Average of ratings: -
Picture of jason everling
Re: InnoDB Upgrade Issues (V2.4) dmlwriteexception
Group Particularly helpful Moodlers

Looks as though the debug message is still picking up that your MySQL Server is running with binlog_format=statement . Maybe clear all caches and restart Apache ? If it still does not go through you can try binlog_format = mixed and it will auto switch to ROW based when needed.


JASON

 
Average of ratings: -
Picture of Constance Horne
Re: InnoDB Upgrade Issues (V2.4) dmlwriteexception
 

The issue was resolved when the statement was moved under the [mysqld] header in /etc/my.cnf like this:

[mysqld]

binlog_format = ROW


When it is placed under any other header, it is ignored.

NOTE: This also requires a stop/restart of MySQL.

 
Average of ratings: -