Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\local_o365\task\coursesync can not create teams on ms side #2635

Closed
stmpk opened this issue Sep 24, 2024 · 2 comments · Fixed by #2668, #2669, #2670 or #2671
Closed

\local_o365\task\coursesync can not create teams on ms side #2635

stmpk opened this issue Sep 24, 2024 · 2 comments · Fixed by #2668, #2669, #2670 or #2671
Assignees
Labels
Feature - teams integration Issue type - help wanted General questions on how to use the plugins, e.g. configurations etc. Plugin - local_o365 Status - In Progress WIP
Milestone

Comments

@stmpk
Copy link

stmpk commented Sep 24, 2024

We have a moodle 4.1.12 installation and have installed MS teams plugins Microsoft 365 Integration and OpenID Connect.

Microsoft 365 Integration has been successfully completed, setup has been verified. Microsoft 365 Integration

Details

Azure App Registration
Verifies the correct parameters are set up in Azure app.
Reply URL Correct
Microsoft Graph API
The Microsoft Graph API allows communication between Moodle and Microsoft 365.
Microsoft Graph API active.
Application Permissions are correct.
Delegated Permissions are correct.

user sync has been complete. Our institution opens around 6k courses every term, about 400 of these are online, and we're trying to use MS Teams as our online classroom solution.
At first we enabled course sync by default, teacher and student roles are passed onto teams as owner and members. Our IT has our institutional email accouns on local servers, so we had to create a new moodle user type , teamsowner, and created new emails for the teachers on both entra and moodle side. Those users are also synced.

After we first synced the courses and users, we disabled course sync for all classes and changed the course sync option to only sync selected courses + newly created courses. Teams sync has been successfull for some courses. Despite our efforts, some teams are not created by api, despite having proper owner and members on moodle side. These are the errors we're receiving.

Details

Processing courses without teams...
... Processing course #61138
......... Could not get existing owners of group with ID b924a35c-59af-4fc0-b7e4-51064ca08b1a. Reason: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Could not get existing members of group with ID b924a35c-59af-4fc0-b7e4-51064ca08b1a. Reason: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
...... Adding 2 owners and 73 members to group with ID b924a35c-59af-4fc0-b7e4-51064ca08b1a
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #1
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #2
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #3
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #4
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #5
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #1
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #2
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #3
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #4
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #5
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #1
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #2
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #3
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #4
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #5
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #1
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #2
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #3
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #4
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #5
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #1
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #2
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #3
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #4
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Retry #5
......... Error: Error in API call: Resource 'b924a35c-59af-4fc0-b7e4-51064ca08b1a' does not exist or one of its queried reference-property objects are not present.
......... Finished adding owners and members to group.
...... Creating class team from education group with ID b924a35c-59af-4fc0-b7e4-51064ca08b1a for course #61138
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: 530941e7c50e4860af04d25353412f92
x-telemetryid: 00-41665c071d58a9be58512b6d6618adaa-5055427e9ad06203-00
X-MSEdge-Ref: Ref A: 060760A9D9664872BEDBDA514AC2A29D Ref B: AMS231020512029 Ref C: 2024-09-24T07:16:27Z
Date: Tue, 24 Sep 2024 07:16:28 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"530941e7c50e4860af04d25353412f92"}
......... Retry #1
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: 882f6ab783c04ca8932d5260b4cdc8a2
x-telemetryid: 00-f71141c19eca2b877a527a286659b606-cbf6fbf22d55cbc1-00
X-MSEdge-Ref: Ref A: 2BA23088EECD4C9A87C7693F395F45B0 Ref B: AMS231032607047 Ref C: 2024-09-24T07:16:39Z
Date: Tue, 24 Sep 2024 07:16:40 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"882f6ab783c04ca8932d5260b4cdc8a2"}
......... Retry #2
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: 28794712b1c3494a86ed3637f84408ca
x-telemetryid: 00-529ac960c3d38a4f1a3d69398fdd76ca-a13f1904629828de-00
X-MSEdge-Ref: Ref A: ADCEFF87E3C8461FBED83CAFC38FA116 Ref B: AMS231020512045 Ref C: 2024-09-24T07:16:51Z
Date: Tue, 24 Sep 2024 07:16:53 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"28794712b1c3494a86ed3637f84408ca"}
......... Retry #3
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: 2ca9da1fafba498ea85f3657d5dbbbb6
x-telemetryid: 00-2433eef96d817aa4a25dcd65999013e4-5a020c4e13f2fd59-00
X-MSEdge-Ref: Ref A: C72EA0D874D3445C9AE4599B6027C36B Ref B: DB3EDGE1721 Ref C: 2024-09-24T07:17:04Z
Date: Tue, 24 Sep 2024 07:17:05 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"2ca9da1fafba498ea85f3657d5dbbbb6"}
......... Retry #4
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: a8bd2634d7b14c0a8244c39d3bc5393c
x-telemetryid: 00-6e9a58d90a8c18807103c794c58dab56-c68c23f55bb510c6-00
X-MSEdge-Ref: Ref A: 0E72204FBA5042D9A8DC35B0AB62CE60 Ref B: AMS231032609035 Ref C: 2024-09-24T07:17:17Z
Date: Tue, 24 Sep 2024 07:17:18 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"a8bd2634d7b14c0a8244c39d3bc5393c"}
......... Retry #5
......... Could not create class team from education group. Reason: Error in API call: Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/b924a35c-59af-4fc0-b7e4-51064ca08b1a/team, Request Method: PUT, Response Status Code: NotFound, Response Headers: Strict-Transport-Security: max-age=2592000
x-operationid: a3f025a23b6e46ff993642c23c348074
x-telemetryid: 00-5f012bdf7025bd75c493774e0fe391e4-538969b82f1b5b09-00
X-MSEdge-Ref: Ref A: 43D4C85780284E099B06DBE1DA6C65BD Ref B: OSL30EDGE0218 Ref C: 2024-09-24T07:17:29Z
Date: Tue, 24 Sep 2024 07:17:30 GMT
, ErrorMessage : {"errors":[{"message":"Failed to execute GetGroupAsync.","errorCode":"Unknown"}],"operationId":"a3f025a23b6e46ff993642c23c348074"}
......... Failed to create class team from education group with ID b924a35c-59af-4fc0-b7e4-51064ca08b1a for course #61138

We'Re at our wit's end, our IT can't help with our error codes.

@weilai-irl weilai-irl self-assigned this Oct 2, 2024
@weilai-irl weilai-irl added Issue type - help wanted General questions on how to use the plugins, e.g. configurations etc. Status - In Progress WIP Feature - teams integration Plugin - local_o365 labels Oct 2, 2024
@weilai-irl
Copy link
Collaborator

Hi @stmpk

I confirm I managed to recreate the issue by following these exact steps:

  1. Create a course but don't enrol anyone in the course yet.
  2. Run the scheduled task to create the group. Since there is no teacher in the course at this time, it will create group only, and not Team.
  3. Delete the group from Microsoft end.
  4. Enrol users to the course in Moodle, and make sure there's at least one teacher.
  5. Run the scheduled task again. Since Moodle has a record of the course connecting to a group, it will try to add users to the group with the ID, and create a Team from the group with the ID. But since the group has been deleted, all related Microsoft Graph API calls return with error.

Actions items from the findings:

  • On the plugin end, we can try to improve error handling. It is a known issue that some scheduled tasks suck at handling errors. It's something off the top of our list to resolve.
  • On your end, please confirm that the group with object ID b924a35c-59af-4fc0-b7e4-51064ca08b1a in your example has actually be deleted, and possibly investigate why the group was deleted.

Regards,
Lai

@stmpk
Copy link
Author

stmpk commented Oct 9, 2024

Thanks, we fixed our sync problem after posting the issue here. This is how we solved it.

  • We stopped course sync scheduled tasks alltogether, course sync and teams users sync tasks.
  • Disabled sync for all classes
  • On teams admin side restored soft deleted teams that should be synced, deleted
  • manually added selected courses to sync list
  • changed number of courses to sync from 20 to 5 in settings,
  • Enabled scheduled tasks again and let them run from cronjob
    After a while, courses from our sync list were created and synced, some had new teams created and we had some duplicate teams with same name but different email alias,

At least we have it working now, thanks.

@stmpk stmpk closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment