Please turn on debugging all the way to developer level, try deleting a course again. Debugging should provide more specific information about the error.
Come back here to this thread and share the text of the debug output you get.
Another place to check ... your web services error log or php error log ... which also might provide clues.
Thanks for your fast response.
I'll do what you say and I'll come back with more details.
Here the debug:
It's deleting CAEICAT1ESO
More information about this error
Error code: backup_user_missing_capability
$a contents: stdClass Object
[userid] => 1
[courseid] => 57
[capability] => moodle/backup:backupcourse
line 158 of /backup/util/checks/backup_check.class.php: backup_controller_exception thrown
line 136 of /backup/controller/backup_controller.class.php: call to backup_check::check_security()
line 119 of /admin/tool/recyclebin/classes/category_bin.php: call to backup_controller->__construct()
line 185 of /admin/tool/recyclebin/lib.php: call to tool_recyclebin\category_bin->store_item()
line 4834 of /lib/moodlelib.php: call to tool_recyclebin_pre_course_delete()
line 67 of /course/delete.php: call to delete_course()
I've disabled the recycle bin and it works!!!
You've saved my life!!!
What is "CAEICAT1ESO"?
Is that a course title/shortname?
The debug does refer to 'recyclebin' and a 'tool_recyclebin_pre_course_delete()' function.
Is that course still viewable? IF so, go all the way to the bottom of that course page and see if there is a module (activity/resource in the course that shows 'deletion pending'.
Emma is probably onto something about roles and permissions (dunno), but let's pursue a little more ...
Do you have access to phpmyadmin or ssh where you can use the mysql client? If so, let's see what is in the mdl_files table related to recyclebin.
mysql> select filename,filearea,userid from mdl_files where filename like '%.mbz';
userid will provide info for checking users permissions on the course, me thinks.
Also check the settings for recyclebin.
In settings, set them to lowest value or shortest time to retain.
Would also set 'auto hide' opposite so that a recyclebin link shows in the course admin menu all the time rather than appearing only when something is in recyclebin. That gives one the ability to force removal the items.
Also check ownerships permissions on your moodledata/temp/backup/ because that is the area moodle will use to build a backup ... recyclebin or other.
Cron job and scheduled task running OK?
There are 2 scheduled task related to recyclebin:
If you set the path to php-cli in your site config, one could use the 'run now' link that would show in either of those task.
And, finally, if you have CLI access, this course deletion could also be 'stuck' and now referenced as such that an adhoc_task needs to be executed.
php adhoc_task.php --execute
Might also give us a clue as to what is failing.
Thanks for your fast response.
I already tried all you say.
So perhaps check that the site administrator user, is actually a site administrator. Might be one you've already covered, but just thought I might share!