Permission related warning and error

Permission related warning and error

by Naveendurai K -
Number of replies: 1

Hai

Im trying to copy the course ,delete a course ,duplicate an activity

but while doing above tasks im getting the following warning and errors

Kindly help me out

Warning: rename(/mnt/moodle_prod_fs/moodledata/filedir/b4/03/b40308475cb92fa6259dd7798b2f2834338daf30,/mnt/moodle_prod_fs/moodledata/trashdir/b4/03/b40308475cb92fa6259dd7798b2f2834338daf30): Permission denied in /var/www/html/moodle_lms_prod/lib/filestorage/file_system_filedir.php on line 314

Warning: fileperms(): stat failed for /mnt/moodle_prod_fs/moodledata/trashdir/b4/03/b40308475cb92fa6259dd7798b2f2834338daf30 in /var/www/html/moodle_lms_prod/lib/filestorage/file_system_filedir.php on line 317

Warning: chmod(): Permission denied in /var/www/html/moodle_lms_prod/lib/filestorage/file_system_filedir.php on line 319

Warning: rmdir(): No such file or directory in /var/www/html/moodle_lms_prod/backup/util/helper/backup_helper.class.php on line 71

error/problem_deleting_old_backup_temp_dirs

More information about this error

×Debug info:
Error code: problem_deleting_old_backup_temp_dirs
$a contents:
×Stack trace:
  • line 179 of /backup/util/helper/backup_helper.class.php: backup_helper_exception thrown
  • line 61 of /backup/moodle2/backup_stepslib.php: call to backup_helper::delete_old_backup_dirs()
  • line 34 of /backup/util/plan/backup_execution_step.class.php: call to drop_and_clean_temp_stuff->define_execution()
  • line 181 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
  • line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 145 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
  • line 410 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
  • line 132 of /admin/tool/recyclebin/classes/category_bin.php: call to backup_controller->execute_plan()
  • line 185 of /admin/tool/recyclebin/lib.php: call to tool_recyclebin\category_bin->store_item()
  • line 5138 of /lib/moodlelib.php: call to tool_recyclebin_pre_course_delete()
  • line 68 of /course/delete.php: call to delete_course()

Average of ratings: -
In reply to Naveendurai K

Re: Permission related warning and error

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

This looks like permission problems with Moodledata. The user your web server runs PHP as cannot write to /mnt/moodle_prod_fs/moodledata/trashdir/b4/03/b40308475cb92fa6259dd7798b2f2834338daf30.

The way I would resolve this is to find out what user your web server runs PHP as – often either apache, www-data or php-fpm – and reset their ownership of Moodledata. For example if the user was apache then run chown -R apache. /mnt/moodle_prod_fs/moodledata. Then you must ensure that any command line script that accesses Moodledata is run as the same user. For example again assuming the user is apache, ensure the cron script is added to apache's crontab (crontab -u apache -e).

The alternative is to grant permission for all users to write to Moodledata with chmod -R 777 /mnt/moodle_prod_fs/moodledata.

Instructions on setting up Moodledata are in the docs.