Backups Failing

Backups Failing

by Ray Lee -
Number of replies: 6

Hello everyone's favorite 'SoS' guy. I hope someday that I can help as much as you do.

I've got an issue you might be able to help with. I already took your suggestion and increased the max_allowed_packet size. In fact I increased it by a factor of 10x. No luck. 

I’m running a test Moodle server on a Synology NAS with the following setup.

Apache HTTP Server 2.4

PHP 7.0

Moodle 3.9.7

MariaDB 10

The problem I’m having is that as soon as a Course gets to a particular size, I get a 504 Gateway Time-out – nginx error. I just ran a test with one of my handmade courses. I only ticked the USER DATA box and unchecked everything else. There are NO users. So my questions are:

1.       Is there a DB setting on my Apache server or something in my MariaDB that would allow for the process to complete without hanging up with that 504 error?

2.       Is there something in the PHP code that would alleviate this issue?

3.       Are there things in the Course itself that I could leave out of the backup that would allow me to easily restore everything done by students in case of a crash?

Ideally I’d like to be able to back up a Course, regardless of size. I have plenty of storage.

Any help anyone can provide will be greatly appreciated. Thanks in advance for your help.

Rgds,

Ray

Average of ratings: -
In reply to Ray Lee

Re: Backups Failing / Timing Out

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Have you checked both your file_upload_size and post_max_size in php.ini? Change them both to be large enough to cover the course backup. Also, look at your execution_timeout and increase it. Also, if there are no users in the course, why are you trying to select user data...you need to select some activities to restore..
In reply to Emma Richardson

Re: Backups Failing / Timing Out

by Ray Lee -
Thank you very much Emma, especially for such a quick reply. I made the changes and completely restarted my server, but still get the 504 Gateway Time-out error. The names of the variables were a bit different; here's what I changed:

upload_max_filesize = 32M, changed to 64M
post_max_size = 32M, changed to 64M
max_execution_time = 240, changed to 480

As you can see I just simply doubled everything. Should I consider going higher, or is there something else I can check? I can backup other Courses I've downloaded, and I can backup my own Courses up to a point. As soon as I reach a certain size it won't back them up. Is it possible that as soon as I included some audiobooks (free, open source), which would of course increase the file size, even though I specifically uncheck them from the backup, they are still being included somehow?

I just completed deleted the audiobooks from the Course and the backup still failed.

BTW - The reason that I selected the user data was to get the smallest file size possible. But I still got the error.

Thanks again for any help you can provide. I'm hoping to go live with one student this weekend as a test. But I want to be able to backup my courses first.

Rgds,
Ray
In reply to Ray Lee

Re: Backups Failing / Timing Out

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Well, what is the size of the file? Please turn debugging on to full developer level and see what error messages you are getting.
In reply to Ray Lee

Re: Backups Failing / Timing Out

by Ken Task -
Picture of Particularly helpful Moodlers

@Ray .... piggy-backing makes threads confusing .... your NAS isn't same as original posters environment ...

Got ssh into your server?

IF so, one can find a backup.php file in code/admin/cli/ that will not use browser/web service .... thus no 504 time outs.

Suggest trying that!

'SoS', Ken


In reply to Ken Task

Re: Backups Failing / Timing Out

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I split this to a separate discussion - sorry, didn't even notice when I replied that it was a different post!