microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
180 stars 136 forks source link

Sync Microsoft 365 Events In To Moodle - Task Fails #2609

Open aboarken opened 1 month ago

aboarken commented 1 month ago

Please I am getting this task error after updating Moodle 4.4.1+ (Build: 20240719) and plugin to latest version. Kindly for your support.

Execute scheduled task: Sync Microsoft 365 events in to Moodle (local_o365\feature\calsync\task\importfromoutlook) ... started 22:33:49. Current memory use 30.1 MB. Debugging increased temporarily due to faildelay of 86400 Syncing events for user #14003 ... used 4 dbqueries ... used 0.01019287109375 seconds Scheduled task failed: Sync Microsoft 365 events in to Moodle (local_o365\feature\calsync\task\importfromoutlook),Failed to parse time string (@2022-03-20T03:00:00.0000000 UTC) at position 8 (-): Double timezone specification Backtrace:

grantcolin commented 1 month ago

We have a similar error after upgrading to Moodle 4.4.1

Execute scheduled task: Cohort sync (local_o365\task\cohortsync) ... started 23:37:13. Current memory use 22.9 MB. Debugging increased temporarily due to faildelay of 61440 ... used 0 dbqueries ... used 0.036664009094238 seconds Scheduled task failed: Cohort sync (local_o365\task\cohortsync),Could not get app or system token. Backtrace:

dragos5436 commented 1 month ago

Hi there,

We have been experiencing the same Cohort sync task failure as above for a while now. It seems to be a scheduled task supposed to run every day. As @grantcolin mentions, we discovered it after upgrading to Moodle 4.4.1 last week (an update in 4.4 pushes notifications to us now about these task failures). However, after checking the logs, it looks like the task has been failing every day since July 1st for us, so probably not related to the upgrade itself. Here is a failure message example (personal data has been removed):

 Execute scheduled task: Cohort sync (local_o365\task\cohortsync)
 ... started 14:08:41. Current memory use 13.6 MB.
 Debugging increased temporarily due to faildelay of 86400
 ... Start updating groups cache.
 ...... Added group ID 9a51bfae-90f2-44dd-8515-8f5ab61d10a4 to cache.
 ...... Added group ID 9a52bb34-1e34-42c5-b106-454b8b68e247 to cache.
 ... used 89361 dbqueries
 ... used 711.84796905518 seconds
 Scheduled task failed: Cohort sync (local_o365\task\cohortsync),Error writing to database (Data too long for column 'name' at row 1
 INSERT INTO mdl_local_o365_groups_cache (objectid,name,description) VALUES(?,?,?)
 [array (
   0 => 'b4725107-2fc0-4d83-aba6-d93181b260be',
   1 => 'username1@emailaddress; username2@emailaddress; username3@emailaddress; username4@emailaddress; username5@emailaddress; username6@emailaddress; username7@emailaddress; username8@emailaddress; username9@emailaddress',
   2 => NULL,
 )])
 Debug info:
 Data too long for column 'name' at row 1
 INSERT INTO mdl_local_o365_groups_cache (objectid,name,description) VALUES(?,?,?)
 [array (
   0 => 'b4725107-2fc0-4d83-aba6-d93181b260be',
   1 => 'username1@emailaddress; username2@emailaddress; username3@emailaddress; username4@emailaddress; username5@emailaddress; username6@emailaddress; username7@emailaddress; username8@emailaddress; username9@emailaddress',
   2 => NULL,
 )]
 Backtrace:
 * line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
 * line 1482 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
 * line 1528 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
 * line 244 of /local/o365/classes/feature/cohortsync/main.php: call to mysqli_native_moodle_database->insert_record()
 * line 72 of /local/o365/classes/task/cohortsync.php: call to local_o365\feature\cohortsync\main->update_groups_cache()
 * line 60 of /local/o365/classes/task/cohortsync.php: call to local_o365\task\cohortsync->execute_sync()
 * line 410 of /lib/classes/cron.php: call to local_o365\task\cohortsync->execute()
 * line 208 of /lib/classes/cron.php: call to core\cron::run_inner_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()

Could you please investigate the cause of this task failure and provide a solution for fixing it?

Thank you.

Moodle version: 4.4.1 Microsoft plugins version:

PHP version: 8.1 Database version: MySQL 8.0.32