Unable remove course from database when press delete button

Unable remove course from database when press delete button

by Yee Hao -
Number of replies: 2

After unable delete course from database it show the message like below



Debug info: MySQL server has gone away

SELECT COUNT(*)

FROM mdllj_backup_ids_temp b

JOIN mdllj_user u ON u.id = b.itemid

WHERE b.backupid = ?

AND b.itemname = 'userfinal'

AND u.mnethostid != ?

[array (

0 => 'ab2e109a519c823351d623c33a602fa6',

1 => '1',

)]

Error code: dmlreadexception

×Stack trace:

line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

line 1175 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

line 1558 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()

line 1631 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()

line 1841 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()

line 477 of /backup/util/dbops/backup_controller_dbops.class.php: call to moodle_database->count_records_sql()

line 1787 of /backup/moodle2/backup_stepslib.php: call to backup_controller_dbops::backup_includes_mnet_remote_users()

line 88 of /backup/util/plan/backup_structure_step.class.php: call to backup_main_structure_step->define_structure()

line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute()

line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()

line 120 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()

line 322 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()

line 121 of /admin/tool/recyclebin/classes/category_bin.php: call to backup_controller->execute_plan()

line 185 of /admin/tool/recyclebin/lib.php: call to tool_recyclebin\category_bin->store_item()

line 4824 of /lib/moodlelib.php: call to tool_recyclebin_pre_course_delete()

line 67 of /course/delete.php: call to delete_course()

Average of ratings: -
In reply to Yee Hao

Re: Unable remove course from database when press delete button

by Siddhant Rao -

Hi,

I am facing the same issue. Were you able to solve it?

Thanks,

Siddhant 

In reply to Yee Hao

Re: Unable remove course from database when press delete button

by Ken Task -
Picture of Particularly helpful Moodlers

Debug gives you the info needed to solve:

Debug info: MySQL server has gone away

The database server couldn't keep up with the data it was processing or getting from the Moodle.

To start, need to add one line to the config file for MySQL if you can:

max_allowed_packet  = 32M
The value of 32M is a guess here.  The default for max_allowed_packet in MySQL 5.5 to 5.7 is 16M.

After adding the line to my.cnf, must restart MySQL for the changes to take effect.

That might get you by.   You might have to make other/more tweaks to DB server config.

'spirit of sharing', Ken