Issue Details (XML | Word | Printable)

Key: MDL-11912
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Nicolas Connault
Reporter: Andrea Bicciolo
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Course Backups fails when including user files

Created: 26/Oct/07 07:54 PM   Updated: 17/Nov/07 01:09 AM
Return to search
Component/s: Backup
Affects Version/s: 1.8.3
Fix Version/s: 1.8.3, 1.9, 2.0

Issue Links:
Relates
 

Participants: Andrea Bicciolo, Eloy Lafuente (stronk7), Miroslav Fikar, Nicolas Connault and Ryan Smith
Security Level: None
Resolved date: 17/Nov/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
To reproduce the bug:

1. enter a course as admin, and make a backup
2. keep User: course as setting and User files: yes
3. launch backup.
4. backup stops showing "An error occurred while coping user files"

When selecting no user OR no user files, backup completes successfully.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Connault added a comment - 27/Oct/07 02:19 PM
So far I haven't been able to reproduce this error.

Andrea Bicciolo added a comment - 28/Oct/07 03:47 AM
Nicolas, thank you for checking.

On your email you'll find a Moodle site URL and credentials to check one of the several site where the problem is happening.


Eloy Lafuente (stronk7) added a comment - 31/Oct/07 06:50 AM
Uhm.... knowing a bit more about Andrea's server configuration... could this be related to this change performed between 1.8.2 and 1.8.3 ?

http://moodle.cvs.sourceforge.net/moodle/moodle/backup/backuplib.php?r1=1.135.2.3&r2=1.135.2.4

(note the "recursive flag" added there)

I guess it isn't necessary and, in fact, if breaking sites with some constraints enabled (open_basedir and friends).

It seems that the same problem is happening in other places too:

http://moodle.org/mod/forum/discuss.php?d=82708

So perhaps that new parameter shouldn't be used? 18_STABLE, 19_STABLE and HEAD.

Ciao


Eloy Lafuente (stronk7) added a comment - 31/Oct/07 06:54 AM
Also, it seems to be a good idea to implement MDL-11437 in all those branches.

Basically it prevents to start the "recursive" task from "/" and, instead, it's starts from "moodledata", that uses to be a correct directory to perform file operations without problems if running under open_basedir and others.

Ciao


Andrea Bicciolo added a comment - 31/Oct/07 05:14 PM - edited
According to the extensive tests done thanks to Eloy, changing the "recursive" to false or undefined allow backups to complete successfully, even with open_basedir setting starting on moodledata.

What about reverting it to it's original state ?

Adding some more hints to reproduce the bug:
1. apache virtual servers environment.
2. open_basedir set to .../vhostfolder/moodledata, vhostfoledr/public_html, /tmp, /usr/bin
3. turn on recursive, backups fails
4. turn off recursive, backups complete


Nicolas Connault added a comment - 31/Oct/07 11:24 PM
Removed the recursive param. Not entirely sure if it should be removed from other places in the backuplib.php code, where it is currently used.

Andrea Bicciolo added a comment - 01/Nov/07 11:05 PM
Based on the test done with Eloy, the parameter should be removed also from other places.

Miroslav Fikar added a comment - 07/Nov/07 08:06 PM
I have the same problem as described. It started with revision 1.93 of backup/lib.php. I have located the problem in the following line (308):
from:
$status = check_dir_exists($to_file, true, true);
to:
$status = mkdir($to_file,$CFG->directorypermissions);

It seems to me, that function backup_copy_dir tries mkdir with an argument that has several new directories in it - and it cannot do it.


Ryan Smith added a comment - 11/Nov/07 04:42 AM - edited
Looks like its working on my end.

Andrea Bicciolo added a comment - 12/Nov/07 05:17 PM
As far as I know the issue is resolved. On all our production systems the patches committed by Eloy and Nicolas works.
Try with the latest CVS version, if not already installed, then try to understand where the automated backups fails from the logs.

Eloy Lafuente (stronk7) added a comment - 17/Nov/07 01:09 AM
Closing this. Thanks for your help!

Ciao