moodle-mod_customcert icon indicating copy to clipboard operation
moodle-mod_customcert copied to clipboard

mod_customcert\task\email_certificate_task not exists and no emails with certificate are send

Open persuader opened this issue 5 months ago • 1 comments

Hi i am using moodle version '4.5.6 (Build: 20250811)' and mod_customcert 4.4.6 - 2024042212 - i have updated from moodle 4.1.20.

In 4.1 when an student completes an exam it recieves email with the certificate - now no such mail is send

Is this task removed in version 4.4.6 ? I have tried with the "Use Email Certificate Ad-hoc Task" on and off but no luck. Other emails for course completion password changes etc are send.

There is no errors in the scheduled task logs. Where might be the problem?

persuader avatar Aug 15 '25 20:08 persuader

Are you able to look at the customcert_issues DB table and see if this has already been issued to that user?

mdjnelson avatar Aug 24 '25 14:08 mdjnelson

I am experiencing a similar issue, so I thought I would share my details. I am also on 4.5.6 of Moodle (20250902) and 4.4.6 of the plugin (2024042213). The only task I have related to certificates is \mod_customcert\task\issue_certificates_task. I used to have a separate schedule task for only email_certificate_task, as it would not complete within a minute. At some point, that task went away. I decided to go the route of ad-hoc task, and it just seems flaky. We have a course released this week, 12 certificates have been issued. 7 of them were emailed on 11/18 at 6:55am (which doesn't seem ad-hoc). 5 have been issued since and none have been emailed. The last task log of the issue_certificates_task was on 11/18. There are no errors, the task isn't being executed. If I disable the adhoc task and run cron, then nothing is emailed, which makes sense, because the legacy email task is gone.

sheetmetaliti avatar Nov 20 '25 15:11 sheetmetaliti

I do see a generic error in php log: [19-Nov-2025 06:59:36 America/New_York] Default exception handler: The operation timed out while waiting for a lock. Debug: Error code: locktimeout

  • line 1034 of \lib\classes\task\manager.php: core\exception\moodle_exception thrown
  • line 206 of \lib\classes\cron.php: call to core\task\manager::get_next_scheduled_task()
  • line 125 of \lib\classes\cron.php: call to core\cron::run_scheduled_tasks()
  • line 186 of \admin\cli\cron.php: call to core\cron::run_main_process()

After toggling adhoc on/off and running cron a few times, it seems to have disappeared. Maybe they will get sent tomorrow at 6:55 am. I'll follow up and let you know.

sheetmetaliti avatar Nov 20 '25 16:11 sheetmetaliti