backup_auto_failed_on_course because Exception: directory_not_exists .../temp/backup/courseid/course

backup_auto_failed_on_course because Exception: directory_not_exists .../temp/backup/courseid/course

by David M -
Number of replies: 2

Our last overnight automated course backups last night has given an error for one course.

Checking the backup report, it says:

Status - Unfinished
1:00:01 AM - backup_auto_failed_on_course coursename
1:00:01 AM - Exception: directory_not_exists /var/data/moodle_sitename/sitename/temp/backup//ffd3653cd1d6ed6d6dd2acc97c35f55f/course

I have had a look in the temp/backup folder above, and it only contains log files, apart from for the courseid folder noted above (I assume that these temporary backup folders normally get deleted after use?). That folder is completely empty, but I notice it has the setgid bit set (if relevant):

drwxrwsrwx 2 www-data www-data  4096 Oct 31 01:00 ffd3653cd1d6ed6d6dd2acc97c35f55f

Can anyone advise what I need to do to fix this situation?

The server has not had any problems with backups up until now. It has been running for some time and is currently running Moodle 3.5.

Average of ratings: -
In reply to David M

Re: backup_auto_failed_on_course because Exception: directory_not_exists .../temp/backup/courseid/course

by Ken Task -
Picture of Particularly helpful Moodlers

Cron job and scheduled task?

/admin/tool/task/scheduledtasks.php

There are several for 'cleanup' + automated backups.
Your issue might be in overlap of a clean up and automated backups that happened to be running at the time. 

Any references in web server error  logs about locks?  Locks supposedly prevent some action from taking place
while a task/process is running ... like auto backup of courses and clean up of  Automated backups area ... moodledata/temp/backup/... there should only be .log files
If all were successful.

If failure happens with same course, inspect the course itself and see if you can make a backup from the course admin menu.

No set/pat answer ... must explore! :|

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: backup_auto_failed_on_course because Exception: directory_not_exists .../temp/backup/courseid/course

by David M -
Thanks, Ken.

There were no errors (but also no logs) for that course backup last night, so I don't know if this means that the problem has sorted itself out or not?

I don't see anything that looks relevant in the webserver logs.

These course backups are done via Courses » Backups » Automated backup setup, which we run at 00:05. The error log for this course happened at 01:00.

The Scheduled Tasks section that you suggested has "Automated backups" \core\task\automated_backup_task, which runs at xx:50 every hour, and also "Clean backup tables and logs" \core\task\backup_cleanup_task, which runs at xx:10 every hour.

Possibly the "Automated backups" hourly task might be clashing? I'm afraid I'm not clear what that does (what it is actually backing up, and where), or what the solution would be?