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

Universal solution for Moodle cron error: The course module ... could not be deleted.

    • MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_401_STABLE
    • Cron error. Course module delete issues

      The issue appears in the cron output:
      Adhoc task failed: core_course\task\course_delete_modules, Coding error detected, it must be fixed by a programmer: The course module SOME_CM_ID could not be deleted.

      It would be fine to found an universal solution for this issue.

      The issue appears for different activities.
      It was noticed for:

      • mod_questionnaire
      • mod_bigbluebuttonbn
      • mod_elluminate
      • mod_turnitintooltwo

      It appears when "Enable course recycle bin" is turned on.

      In DB it looks the same for at least most of the cases:

      • No record in plugin's table like mdl_questionnaire or mdl_bigbluebuttonbn,
      • Kept record in mdl_course_modules

       

      Possible solution:

      Check mdl_course_modules table in a cron is there related records in the plugin's tables and remove orphaned course module records.

       

      To Verify:

      The CM id is present in the mdl_course_modules, mdl_course_sections ( sequence) and mdl_context, just missing from instance table eg. mdl_assign

       

       

            Votes:
            41 Vote for this issue
            Watchers:
            63 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Time Spent - 3 hours, 45 minutes Remaining Estimate - 3 days, 1 hour
                3d 1h
                Logged:
                Time Spent - 3 hours, 45 minutes Remaining Estimate - 3 days, 1 hour
                3h 45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.