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

scheduled task failure: \qtype_random\task\remove_unused_questions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.7.2
    • 3.7.6, 3.8.3
    • Questions

    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

            timhunt Tim Hunt
            leelumultipass1 Rebecca Trynes
            Simey Lameze Simey Lameze
            Adrian Greeve Adrian Greeve
            CiBoT CiBoT
            Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              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