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

Forum mailings and maintenance jobs fails with "error/usernotconfirmed" exception

XMLWordPrintable

      This is basically the same problem that we already fixed in MDL-65655 but we haven't covered all the possible causes of failures there.

      This new problem has been detected on learn.moodle.net site. The forum mailings and maintenance scheduled task fails with an error like

      ...
          Queued 0 digests and 1 messages for 71321
          Queued 0 digests and 2 messages for 74001
          Queued 0 digests and 1 messages for 70993
          Queued 0 digests and 1 messages for 73853
      ... used 227 dbqueries
      ... used 0.8561999797821 seconds
      Scheduled task failed: Forum mailings and maintenance jobs (mod_forum\task\cron_task),error/usernotconfirmed
      

      As has been described in MDL-65655, the forum mailings jobs end up calling core_user::require_active_user() which throws an exception in several cases:

      • if the user has been suspended or their auth method is set to 'nologin' - this case has been fixed in MDL-65655 so such users do not cause exceptions any more.
      • if the user is not a real one - e.g. non-existing user record etc. This is valid unexpected situation and throwing the exception is correct.
      • if the user is deleted - deleted users should never be returned as subscribed because we use get_enrolled_sql() which implicitly filters out deleted users.
      • if the user is the guest user - the guest user is filtered out explicitly in the forum's fetch_subscribed_users() method
      • if the user has not been confirmed yet - this is the last case that we do not have covered yet

      We need to make sure that we do not have unconfirmed users returned as notification recipients.

        1. screenshot-1.png
          112 kB
          David Mudrák (@mudrd8mz)

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            Amaia Anabitarte Amaia Anabitarte
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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