Immediately after a course deletion, you see this type of message on all pages.
Error: Invalid context creation request for level "50", instance "7". in /var/www/stable/lib/accesslib.php on line 1675 in debugging()
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND userid = 2' at line 3
SELECT * FROM clean_role_assignments WHERE contextid = AND userid = 2 in /var/www/stable/lib/dmllib.php on line 677 in debugging()