2.1 Backup - Error writing to database

2.1 Backup - Error writing to database

by Shawn Peters -
Number of replies: 12

So just upgraded to Moodle v2.1 the other day (from v1.9).  All seemed to go well with the upgrade but we have 3 courses (out of 60+) that don't want to backup. The automatic backup just tells me there are 3 unfinished course backups. Yes they were backing up prior to 2.1 upgrade on v1.9.

When I manually run the failed course backup I just get a message on the screen saying:

 "Error writing to database"
 "Error reading from database"

That's all, nothing else.  The backup report doesn't list anything for that course.
If I run a restore on the failed coure the same thing occurs, 2 message appear in browser.

I'm not super familar with Moodle (was an inherated server) so I'm not 100% sure where I should be looking.  Any suggestions would be greatly appreciated.

Running a backup on another course manually works fine.

 

Suggestions?   I'm out of ideas and couldn't find anything similar to this in the forums (unless I'm looking for the wrong stuff).

Running Moodle with XAMPP - latest release, on Windows Server 2008R2.

 

Thanks,
 †Shawn

Average of ratings: -
In reply to Shawn Peters

Re: 2.1 Backup - Error writing to database

by harshal mundiwale -

i have a huge course must be about 900mb in size. the course is a topic type, contains 7 sections with a total activity (scorm mainly) count of about 200.

the back up fails saying "error writing to database" "error reading from database."

In reply to harshal mundiwale

Re: 2.1 Backup - Error writing to database

by Gunnar Johannesmeyer -

I've got the same problem:

Solution:

edit the my.ini in the mysql/bin directory and change the max_allowed_packet = 1M to e.g. max_allowed_packet = 100M.

Gunnar

Average of ratings: Useful (4)
In reply to Gunnar Johannesmeyer

Re: 2.1 Backup - Error writing to database

by Shawn Peters -

THANK YOU!!!!!!  big grin

Changing the 'max_allowed_packet' up to 100M did the trick.  All my courses are backing up properly again.

Thanks again, so much!!!

- Shawn

In reply to Gunnar Johannesmeyer

Re: 2.1 Backup - Error writing to database

by llywelyn morgan -

thanks gunnar

seems to have sorted out my problem as well.  any changes to course settings brought up the 'error writing to database' message.

In reply to llywelyn morgan

Re: 2.1 Backup - Error writing to database

by llywelyn morgan -

spoke too soon.  it's doing it again and i haven't even touched any server settings, php files or anything!!

In reply to llywelyn morgan

Re: 2.1 Backup - Error writing to database

by llywelyn morgan -

hmmm.  it seems the problem is when i attempt to change the max post and file size in php above 2000M.  is it not possible to do so as i need to restore three courses that are 2.5gb each?

In reply to Gunnar Johannesmeyer

Re: 2.1 Backup - Error writing to database

by Vicente Jiménez Aguilar -

This solution also worked for me.

Trying to restore an old 1.9 backup, it  gives me an error between step 2 and 3 (so I never saw step 3). The error message changed when I upgraded from plain 2.2 to 2.2+. I'm not 100% shure about those but I think the first was "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error" and the second was "error writing to database". Clearly, the second error message was more accurate.

Increasing max_allowed_packet on the MySQL server removes the problem.

I thought maybe 100M were too much an for me the value of 16M also worked perfectly. I haven't tried any lower value. But be aware that lowering the value too much could affects some backups again.

Maybe a developper can recomend a value and include it somewhere in the documentation.

As the official MySQL Server documentation says:

"It is safe to increase the value of this variable because the extra memory is allocated only when needed."

Reference:

 * http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

 * http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_max_allowed_packet

Average of ratings: Useful (1)
In reply to Vicente Jiménez Aguilar

Re: 2.1 Backup - Error writing to database

by Jerin das -

Hi Gunnar,

Thanks alot..your solution helped me alot.

Regards,

Jerin

In reply to Gunnar Johannesmeyer

Re: 2.1 Backup - Error writing to database

by Iroshini Ratnapala -

Thank you Gunnar, Your solution worked for me also.

In reply to Iroshini Ratnapala

Re: 2.1 Backup - Error writing to database

by Rui Pimenta -

Hi!

I have the same problema, but i use SQLServer20008 and i don't have that variable and file. Can anyone help. Thanks in advance. Best regards.

In reply to Gunnar Johannesmeyer

إعادة: Re: 2.1 Backup - Error writing to database

by Weaam Mohamed -
where can i find this file in godaddy server ?