Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66070

Cannot delete specific user without running cron

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.4
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      Error message:

      Debug info: SELECT id,category FROM {course} WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      ×Stack trace:
      line 1546 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6813 of /lib/accesslib.php: call to moodle_database->get_record()
      line 70 of /lib/classes/event/grade_deleted.php: call to context_course::instance()
      line 1119 of /lib/grade/grade_grade.php: call to core\event\grade_deleted::create_from_grade()
      line 1532 of /lib/gradelib.php: call to grade_grade->delete()
      line 4169 of /lib/moodlelib.php: call to grade_user_delete()
      line 107 of /admin/user.php: call to delete_user()

      I found something similar on https://moodle.org/mod/forum/discuss.php?d=381116

      and bug related to the discussion https://tracker.moodle.org/browse/MDL-64878

      which should be fixed in 3.6.3, so it's different, but with similar symptoms.

      After running cron.php manually (form cli), the problem is gone.

      root@scorpio:/var/www/elo/moodle/admin/cli# php cron.php
      Server Time: Wed, 03 Jul 2019 14:07:03 +0200

      Execute scheduled task: Bereken algemene voltooiingsgegevens (core\task\completion_regular_task)
      ... started 14:07:03. Current memory use 13.8MB.
      ... used 6 dbqueries
      ... used 0.081935882568359 seconds
      Scheduled task complete: Bereken algemene voltooiingsgegevens (core\task\completion_regular_task)
      Cron script completed correctly
      Cron completed at 14:07:03. Memory used 18.8MB.
      Execution took 0.480966 seconds
      root@scorpio:/var/www/elo/moodle/admin/cli# php cron.php
      Server Time: Wed, 03 Jul 2019 14:07:10 +0200

      Cron script completed correctly
      Cron completed at 14:07:10. Memory used 13.6MB.
      Execution took 0.018709 seconds

      Cron runs fine every minute on this site.  I know this will be a hard one to reproduce or fix, but it seems like something is not robust enough somewhere. 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              koen Koen Roggemans
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: