Meta Course Backup Failure V2.2.2

Meta Course Backup Failure V2.2.2

by Peter Ward -
Number of replies: 3

Moodle v2.2.2

All my courses are small.

Courses with self authentication backup OK

Courses with Paypal authentication backup OK

Meta courses which auto enrol students from the Paypal courses fail to backup.

Anyone had a similar problem? Here's hoping you can steer me in the right direction.

Here's the debugging script:


Error reading from database

Debug info: MySQL server has gone away
SELECT * FROM mdl_backup_controllers WHERE backupid = ?
[array (
0 => '63e30988e2e1d88a19cc1e1a53aac91f',
)]
Stack trace:
  • line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 809 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1297 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1269 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
  • line 1249 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 76 of /backup/util/dbops/backup_controller_dbops.class.php: call to moodle_database->get_record()
  • line 308 of /backup/util/dbops/backup_controller_dbops.class.php: call to backup_controller_dbops::load_controller()
  • line 183 of /backup/util/helper/backup_helper.class.php: call to backup_controller_dbops::get_moodle_backup_information()
  • line 1544 of /backup/moodle2/backup_stepslib.php: call to backup_helper::store_backup_file()
  • line 34 of /backup/util/plan/backup_execution_step.class.php: call to backup_store_backup_file->define_execution()
  • line 153 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
  • line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 106 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
  • line 304 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
  • line 111 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
  • line 89 of /backup/backup.php: call to backup_ui->execute()
Error reading from database
Debug info: MySQL server has gone away
SELECT
bi.id,
bp.id AS blockpositionid,
bi.blockname,
bi.parentcontextid,
bi.showinsubcontexts,
bi.pagetypepattern,
bi.subpagepattern,
bi.defaultregion,
bi.defaultweight,
COALESCE(bp.visible, 1) AS visible,
COALESCE(bp.region, bi.defaultregion) AS region,
COALESCE(bp.weight, bi.defaultweight) AS weight,
bi.configdata
, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance

FROM mdl_block_instances bi
JOIN mdl_block b ON bi.blockname = b.name
LEFT JOIN mdl_block_positions bp ON bp.blockinstanceid = bi.id
AND bp.contextid = ?
AND bp.pagetype = ?
AND bp.subpage = ?
LEFT JOIN mdl_context ctx ON (ctx.instanceid = bi.id AND ctx.contextlevel = 80)

WHERE
(bi.parentcontextid = ? OR (bi.showinsubcontexts = 1 AND bi.parentcontextid IN (?,?)))
AND bi.pagetypepattern IN (?,?,?,?)
AND (bi.subpagepattern IS NULL OR bi.subpagepattern = ?)

AND b.visible = 1

ORDER BY
COALESCE(bp.region, bi.defaultregion),
COALESCE(bp.weight, bi.defaultweight),
bi.id
[array (
0 => '194',
1 => 'backup-backup',
2 => '',
3 => '194',
4 => '222',
5 => '1',
6 => 'backup-backup',
7 => 'backup-backup-*',
8 => 'backup-*',
9 => '*',
10 => '',
)]
Stack trace:
  • line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 768 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 601 of /lib/blocklib.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 1207 of /lib/pagelib.php: call to block_manager->load_blocks()
  • line 720 of /lib/pagelib.php: call to moodle_page->starting_output()
  • line 632 of /lib/outputrenderers.php: call to moodle_page->set_state()
  • line 2062 of /lib/outputrenderers.php: call to core_renderer->header()
  • line 334 of /lib/setuplib.php: call to core_renderer->fatal_error()
  • line ? of unknownfile: call to default_exception_handler()


Fatal error: Uncaught exception 'dml_read_exception' with message 'Error reading from database' in /home/enebosh1/public_html/lib/dml/moodle_database.php:394 Stack trace: #0 /home/enebosh1/public_html/lib/dml/mysqli_native_moodle_database.php(377): moodle_database->query_end(false) #1 /home/enebosh1/public_html/lib/ddl/sql_generator.php(181): mysqli_native_moodle_database->get_tables() #2 /home/enebosh1/public_html/lib/ddl/database_manager.php(104): sql_generator->table_exists(Object(xmldb_table)) #3 /home/enebosh1/public_html/lib/ddl/database_manager.php(514): database_manager->table_exists(Object(xmldb_table)) #4 /home/enebosh1/public_html/lib/dml/moodle_temptables.php(130): database_manager->drop_temp_table(Object(xmldb_table)) #5 /home/enebosh1/public_html/lib/dml/moodle_database.php(322): moodle_temptables->dispose() #6 /home/enebosh1/public_html/lib/dml/mysqli_native_moodle_database.php(334): moodle_database->dispose() #7 /home/enebosh1/public_html/lib/dml/moodle_database.php(140): mysqli_native_moodle_database->dis in /home/enebosh1/public_html/lib/dml/moodle_database.php on line 394

Average of ratings: -
In reply to Peter Ward

Re: Meta Course Backup Failure V2.2.2

by Ken Task -
Picture of Particularly helpful Moodlers

First line tells all and is probably responsible for all the rest you see following:

'MySQL server has gone away'

According to many issues found in a Google search for that error, the fix might be to increase max_packet_size in my.cnf (MySQL config).  If there is not a line for that in the config, add it under [mysqld]. Value: 16M (a guess). Changes to that config require restart of MySQL services.

'spirit of sharing', Ken

In reply to Ken Task

Re:Large Course Backup Failure V2.2.2

by Peter Ward -

Many thanks Ken.

|'ll have to ask my server techs to do this for me.

Interestingly for others following this thread:

Have just backed up and restored a meta course successfully, (although meta enrolments are skipped but the error message told me this was a feature not enable untill moodle v2.0  ??, so no probs there)

So the difference between the successful and unsuccessful meta course backups is that the unsuccessful one had a large SCORM package within it.


My conclusion. Ken's advice is probably correct and my forum post should be named 'Large Course Backup Failure' so I'll rename that now.

Cheers.

In reply to Ken Task

Re: Meta Course Backup Failure V2.2.2

by Anil Sharma -

We've backed up come courses from a moodle 1.9.4 install and are trying to restore to a 2.3.2.  While some courses get restored, others face the "error reading from database" issue Debug shows the same "MySQL server has gone away" but if we monitor MySQL, it's alive.  max_allowed_packet in my.cnf is already set to 256M, I think max_packet_size is not an accepted command cause everytime I add that, mysql won't start.

What could possibly be causing the ""error reading from database" issue

Thanks for any inputs.