microsoft / o365-moodle

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

Failing scheduled tasks for Sync Microsoft 365 events #2621

Open scoriess opened 1 month ago

scoriess commented 1 month ago

We have failing scheduled tasks for Sync Microsoft 365 events in to Moodle \local_o365\feature\calsync\task\importfromoutlook

The corresponding task-log:

admin/tasklogs.php?logid=61150126

Execute scheduled task: Microsoft 365-Ereignisse mit Moodle synchronisieren (local_o365\feature\calsync\task\importfromoutlook)
... started 01:46:06. Current memory use 20.9 MB.
Debugging increased temporarily due to faildelay of 61440
Syncing events for user #3577
... used 6 dbqueries
... used 0.29813098907471 seconds
Scheduled task failed: Microsoft 365-Ereignisse mit Moodle synchronisieren (local_o365\feature\calsync\task\importfromoutlook),Failed to parse time string (@2024-07-09T15:30:00.0000000 UTC) at position 8 (-): Double timezone specification
Backtrace:
* line 1263 of /local/o365/classes/rest/unified.php: call to DateTime->__construct()
* line 419 of /local/o365/classes/feature/calsync/main.php: call to local_o365\rest\unified->get_events()
* line 75 of /local/o365/classes/feature/calsync/task/importfromoutlook.php: call to local_o365\feature\calsync\main->get_events()
* line 263 of /lib/cronlib.php: call to local_o365\feature\calsync\task\importfromoutlook->execute()
* line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
* line 178 of /admin/cli/cron.php: call to cron_run()

The relevant part in that log seems to be: (local_o365\feature\calsync\task\importfromoutlook),Failed to parse time string (@2024-07-09T15:30:00.0000000 UTC) at position 8 (-): Double timezone specification

Since this scheduled task is part of the Microsoft plugin local_o365 we looked up whether it has a bug-tracker and then checked the existing/reported issues there.

First we found this issue: https://github.com/microsoft/o365-moodle/issues/2544 and someone mentioned the same error message in a comment: https://github.com/microsoft/o365-moodle/issues/2544#issuecomment-2047709765 but was rejected by one of the devs and asked to create a new issue. But that dev also pointed to the Outlook timezone setting: https://github.com/microsoft/o365-moodle/issues/2544#issuecomment-2157961866 "Please report it separately as a new issue. In your case, I'd like to know the Microsoft user's Outlook timezone setting."

So, we checked the other issues mentioning this setting and found the following comment, informing, that since a release for Moodle 3.9 there is the option to enable a timezone related sync-setting in the Plugin-settings: https://github.com/microsoft/o365-moodle/issues/1389#issuecomment-729746009

Here is the location of these plugin-settings on the Moodle instance with the issue:

Site administration > Plugins > Microsoft 365 Integration > Sync Settings /admin/settings.php?section=local_o365&s_local_o365_tabs=1

image

There are two options dedicated to "Sync Outlook":

So we enabled the first one and ran the scheduled task but it still fails with the same error message. :(

Hence we created this new issue dedicated to this error.

Kindly advise

weilai-irl commented 3 days ago

Hi @scoriess,

The "Double timezone specification" error should have been fixed in the June 2024 release of the plugin for Moodle 4.1 to 4.4. It was tracked in #2589. Please check out the latest version and confirm if this solves the issue for you.

Regards, Lai