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

Adhoc task failed: mod_forum\task\send_user_notifications,Error writing to database (Deadlock found when trying to get lock; try restarting transaction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5.1
    • Forum, Tasks
    • None
    • MOODLE_405_STABLE

      Execute adhoc task: mod_forum\task\send_user_notifications
      Adhoc task id: 6007339
      Adhoc task custom data: ["63046"]
      ... started 11:52:03. Current memory use 54.1 MB.
      Sending messages to
      [removed mailaddress]
      (28792)
      Post 63046 sent
      Sent 1 messages with 0 failures
      Marking posts as read
      ... used 28 dbqueries
      ... used 0.16249585151672 seconds
      Adhoc task failed: mod_forum\task\send_user_notifications,Error writing to database (Deadlock found when trying to get lock; try restarting transaction
      INSERT INTO mdl_forum_read (userid, postid, discussionid, forumid, firstread, lastread)

      SELECT ?, p.id, p.discussion, d.forum, ?, ?
      FROM mdl_forum_posts p
      JOIN mdl_forum_discussions d ON d.id = p.discussion
      JOIN mdl_forum f ON f.id = d.forum
      LEFT JOIN mdl_forum_track_prefs tf ON (tf.userid = ? AND tf.forumid = f.id)
      LEFT JOIN mdl_forum_read fr ON (
      fr.userid = ?
      AND fr.postid = p.id
      AND fr.discussionid = d.id
      AND fr.forumid = f.id
      )
      WHERE p.id = ?
      AND p.modified >= ?
      AND ((f.trackingtype = 1 OR f.trackingtype = 2)
      AND tf.id IS NULL)
      AND fr.id IS NULL
      [array (
      0 => '28792',
      1 => 1739530323,
      2 => 1739530323,
      3 => '28792',
      4 => '28792',
      5 => 63046,
      6 => 1738320723,
      )])
      Debug info:
      Deadlock found when trying to get lock; try restarting transaction
      INSERT INTO mdl_forum_read (userid, postid, discussionid, forumid, firstread, lastread)

      SELECT ?, p.id, p.discussion, d.forum, ?, ?
      FROM mdl_forum_posts p
      JOIN mdl_forum_discussions d ON d.id = p.discussion
      JOIN mdl_forum f ON f.id = d.forum
      LEFT JOIN mdl_forum_track_prefs tf ON (tf.userid = ? AND tf.forumid = f.id)
      LEFT JOIN mdl_forum_read fr ON (
      fr.userid = ?
      AND fr.postid = p.id
      AND fr.discussionid = d.id
      AND fr.forumid = f.id
      )
      WHERE p.id = ?
      AND p.modified >= ?
      AND ((f.trackingtype = 1 OR f.trackingtype = 2)
      AND tf.id IS NULL)
      AND fr.id IS NULL
      [array (
      0 => '28792',
      1 => 1739530323,
      2 => 1739530323,
      3 => '28792',
      4 => '28792',
      5 => 63046,
      6 => 1738320723,
      )]
      Backtrace:

      • line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
      • line 1258 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
      • line 4198 of /mod/forum/lib.php: call to mysqli_native_moodle_database->execute()
      • line 182 of /mod/forum/classes/task/send_user_notifications.php: call to forum_tp_mark_posts_read()
      • line 519 of /lib/classes/cron.php: call to mod_forum\task\send_user_notifications->execute()
      • line 302 of /lib/classes/cron.php: call to core\cron::run_inner_adhoc_task()
      • line 128 of /lib/classes/cron.php: call to core\cron::run_adhoc_tasks()
      • line 186 of /admin/cli/cron.php: call to core\cron::run_main_process()

            Unassigned Unassigned
            elodelta Richard van Iwaarden
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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