-
Bug
-
Resolution: Fixed
-
Major
-
3.7
-
MOODLE_37_STABLE
-
MOODLE_37_STABLE
-
MDL-65888-master -
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-65655so 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.
- has been marked as being related by
-
MDL-66561 Forum mailings and maintenance jobs fails with error writing to database
- Open
-
MDL-65655 Forum mailings and maintenance jobs fails with "Suspended account" exception
- Closed
- is a regression caused by
-
MDL-46881 Refactor forum scheduled task (cron) into several smaller cron tasks
- Closed