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

scheduled task failure: \qtype_random\task\remove_unused_questions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7.2
    • Fix Version/s: 3.7.6, 3.8.3
    • Component/s: Questions
    • Labels:

      Description

      The scheduled task \qtype_random\task\remove_unused_questions fails due to missing record in mdl_context.

      The CLI fix_orphaned_question_categories also fails on this error, which is to be expected with an orphaned category!

      The failure is due to the event creation on delete questions.

      -----------------------------------------------------------------------------

      Full error:

      Execute scheduled task: Remove unused random questions (qtype_random\task\remove_unused_questions)
      ... used 5097 dbqueries
      ... used 8.9891879558563 seconds
      Scheduled task failed: Remove unused random questions (qtype_random\task\remove_unused_questions),Can't find data record in database table context.
      Debug info:
      SELECT * FROM \{context} WHERE id = ?
      [array (
       0 => '2040510',
      )]
      Backtrace:
      * line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      * line 5191 of /lib/accesslib.php: call to moodle_database->get_record()
      * line 221 of /lib/classes/event/base.php: call to context::instance_by_id()
      * line 125 of /lib/classes/event/question_base.php: call to core\event\base::create()
      * line 385 of /lib/questionlib.php: call to core\event\question_base::create_from_question_instance()
      * line 61 of /question/type/random/classes/task/remove_unused_questions.php: call to question_delete_question()
      * line 157 of /admin/tool/task/cli/schedule_task.php: call to qtype_random\task\remove_unused_questions->execute()
      

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            leelumultipass1 Rebecca Trynes
            Peer reviewer:
            Simey Lameze Simey Lameze
            Integrator:
            Adrian Greeve Adrian Greeve
            Tester:
            CiBoT CiBoT
            Participants:
            Component watchers:
            Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 30 minutes
                3h 30m