-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.10
-
None
-
MOODLE_310_STABLE
Question import fails with "Invalid permissions detected when trying to create a directory. Turn debugging on for further details." when open_basedir prevents access to the path returned by sys_get_temp_dir(). See also this forum reply.
This does not happen with Moodle 3.9.
Steps to reproduce this:
- Export a question bank as a file.
- Set PHP's open_basedir to include the site's Moodledata directory but not the directory returned by sys_get_temp_dir(). You may need to configure PHP's upload_tmp_dir for file uploads to work, this location must also be within open_basedir.
- If necessary restart any services (e.g. Apache or PHP-FPM) to pick up the PHP configuration change.
- Within a course select the question bank file from step 1, and select its type (e.g. "Moodle XML format"). Click "Import".
Expected results:
The question bank is imported without error.
Actual results:
Warning: file_exists(): open_basedir restriction in effect. File(/tmp/requestdir/Q7dI) is not within the allowed path(s): (/var/www) in /var/www/moodle.example.com/moodle/lib/setuplib.php on line 1538
Warning: file_exists(): open_basedir restriction in effect. File(/tmp/requestdir/Q7dI) is not within the allowed path(s): (/var/www) in /var/www/moodle.example.com/moodle/lib/setuplib.php on line 1548
Warning: is_dir(): open_basedir restriction in effect. File(/tmp/requestdir/Q7dI) is not within the allowed path(s): (/var/www) in /var/www/moodle.example.com/moodle/lib/setuplib.php on line 1552
Invalid permissions detected when trying to create a directory. Turn debugging on for further details.
More information about this error
Debug info: /tmp/requestdir/Q7dI can not be created, check permissions.
Error code: invaliddatarootpermissions
Stack trace:
line 1554 of /lib/setuplib.php: invalid_dataroot_permissions thrown
line 1645 of /lib/setuplib.php: call to make_writable_directory()
line 1675 of /lib/setuplib.php: call to get_request_storage_directory()
line 89 of /question/import.php: call to make_request_directory()
- is a regression caused by
-
MDL-66928 Cron throws exceptions during a cache purge as localcachedir is purged / get_request_storage_directory should use system temp
- Closed