error/moodle/dmlwriteexception
From MoodleDocs
This indicates that a general error occurred when Moodle tried to write to the database. If you turn on Debugging you will get more detailed information about what the problem is.
MySQL
If you're using a MySQL database for your Moodle installation, this error can be caused by the server's max_allowed_packet
size being configured incorrectly. Increasing this value may resolve the issue.