Can't backup Front Page Settings course

Can't backup Front Page Settings course

by David Rogers -
Number of replies: 6
Hello,

All my other courses backup just fine,  but I'm unable to backup my Front Page Settings course (either manually or via automated backup).  With debugging turned on, I get the following error:

1. Initial settings / ? 2. Schema settings / ? 3. Confirmation and review / ? 4. Perform backup / ? 5. Complete

412.49 sec
 5.7%

Error reading from database

More information about this error
Debug info: MySQL server has gone away
SELECT COUNT('x') FROM mdl_backup_ids_temp WHERE backupid = ? AND itemname = ?
[array (
0 => '897858a1bec1eced6caf3d6d403f6ec1',
1 => 'user',
)]
Error code: dmlreadexception
Stack trace:

    line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 996 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
    line 1428 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
    line 1501 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
    line 1672 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
    line 1655 of /lib/dml/moodle_database.php: call to moodle_database->count_records_sql()
    line 1638 of /lib/dml/moodle_database.php: call to moodle_database->count_records_select()
    line 163 of /backup/util/dbops/backup_structure_dbops.class.php: call to moodle_database->count_records()
    line 1481 of /backup/moodle2/backup_stepslib.php: call to backup_structure_dbops::annotations_exist()
    line 88 of /backup/util/plan/backup_structure_step.class.php: call to backup_inforef_structure_step->define_structure()
    line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute()
    line 177 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 320 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 131 of /backup/backup.php: call to backup_ui->execute()


I've looked into some other threads and verified that my Moodle database user has all permissions to my Moodle database, including CREATE TEMPORARY TABLES.

Files are being created successfully in the my /moodledata/temp/backup directory, and my .LOG file is empty which I believe indicates there are no errors.  The whole backup of this course is only about 19MB.  I've attached a couple screenshots showing those directories.

It's also strange that the backup outputs 412.49 seconds, but only about 25 seconds are elapsing from when I click "Perform Backup" until the error screen appears.  Adjusting my PHP max_execution_time from 30 to 60 seconds doesn't help, and the error still appears after about 25 seconds.

Any ideas what I can do to enable this one course to backup successfully?

Thanks!

David

Attachment moodle_backup_course_directory.png
Attachment moodle_backup_directory.png
Average of ratings: -
In reply to David Rogers

Re: Can't backup Front Page Settings course

by David Rogers -

As an update, I've also found the following messages in the error_log generated in the home directory of my hosting account every time cron tries to execute the automated backup:


[09-May-2014 08:30:40 CST6CDT] Potential coding error - existing temptables found when disposing database. Must be dropped!
In reply to David Rogers

Re: Can't backup Front Page Settings course

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Apologies in advance as this is of no help to you at all, but could I ask why you want to back up your front page? If it is to restore it to another Moodle then I am afraid the current front page restore is broken - see MDL-31500

In reply to Mary Cooch

Re: Can't backup Front Page Settings course

by David Rogers -

No apology necessary.  smile

I'm just getting notified every time automatic backup runs that this one "course" is failing.  I'd like to figure out how to resolve the issue if possible.  It's odd that it's only happening for this one course.  All the other courses backup just fine.
In reply to David Rogers

Re: Can't backup Front Page Settings course

by Ken Task -
Picture of Particularly helpful Moodlers

The hint in in the error  ... mysql server has gone away ...

increase the query limit by setting the mysql server's max_allowed_packet variable, which has a default value of 1MB.   Set that to something higher - guess: 10MB.   Changes to mysql require restart of the mysql server.

If I'm not mistaken the front page is really course ID 1 and includes all users of the site (at least it used to).
That just a bit of info as one cannot use that backup to restore the 'front page' of Moodle.

'spirit of sharing', Ken

In reply to Ken Task

Re: Can't backup Front Page Settings course

by David Rogers -
Thank you for your response.  

The default max_allowed_packet on my server was set at 16M. 

I've tried increasing that value, setting it as high as 1024M, restarting mysqld each time, and the error still occurs. 

Appreciate your help!
In reply to David Rogers

Re: Can't backup Front Page Settings course

by David Rogers -

Good news!  I've discovered the fix.

By default, the site was running php version 5.3.26.  I switched to using php version 5.4.27 and the backup of the Front Page Settings course now works just fine.