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

Failing scheduled task #607

Open
jwalits opened this issue Jul 26, 2024 · 5 comments
Open

Failing scheduled task #607

jwalits opened this issue Jul 26, 2024 · 5 comments
Assignees
Labels
more information needed Need more information from user

Comments

@jwalits
Copy link
Contributor

jwalits commented Jul 26, 2024

We're constantly getting this error. It feels like the scheduled task should handle this failure a bit more gracefully rather than having to disable the scheduled task manually.

Scheduled task failed: Get meeting report from Zoom (mod_zoom\task\get_meeting_reports),Zoom received a bad request: This API is only available for ZMP and Business or higher accounts that have enabled the Dashboard feature.
Backtrace:
 * line 359 of /mod/zoom/classes/webservice.php: call to mod_zoom\webservice->make_call()
 * line 976 of /mod/zoom/classes/webservice.php: call to mod_zoom\webservice->make_paginated_call()
 * line 430 of /mod/zoom/classes/task/get_meeting_reports.php: call to mod_zoom\webservice->get_meetings()
 * line 159 of /mod/zoom/classes/task/get_meeting_reports.php: call to mod_zoom\task\get_meeting_reports->get_meetings_via_dashboard()
 * line 410 of /lib/classes/cron.php: call to mod_zoom\task\get_meeting_reports->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()

@jrchamp
Copy link
Collaborator

jrchamp commented Jul 26, 2024

Hi @jwalits,

The message from Zoom is saying that your account does not have permissions to use the Dashboard APIs. The plugin handles this by checking if the Dashboard scope has been granted:

$dashboardscopes = [
'dashboard_meetings:read:admin',
'dashboard_meetings:read:list_meetings:admin',
'dashboard_meetings:read:list_webinars:admin',
];
$reportscopes = [
'report:read:admin',
'report:read:list_users:admin',
];
// Can only query on $hostuuids using Report API.
if (empty($hostuuids) && $this->service->has_scope($dashboardscopes)) {

If you remove the Dashboard scopes from your Marketplace App, it should fix the error. Please let us know if the Marketplace app does not have those scopes granted and you continue to encounter the error.

@jrchamp jrchamp added the more information needed Need more information from user label Jul 26, 2024
@jrchamp jrchamp self-assigned this Jul 26, 2024
@jwalits
Copy link
Contributor Author

jwalits commented Jul 29, 2024

Thanks @jrchamp - I'll reach out to the team internally and see if they can remove that scope from the App. I dont have the access to the zoom side of things yet!

Thanks again for the quick feedback.

@jwalits
Copy link
Contributor Author

jwalits commented Aug 7, 2024

Hey @jrchamp

I've been able to login and check the marketplace app. I have deleted the Dashboard scopes from that app and now we are seeing a different error

 Scheduled task failed: Get meeting report from Zoom (mod_zoom\task\get_meeting_reports),Zoom received a bad request:
 Invalid access token, does not contain scopes:[dashboard_meetings:read:admin, dashboard:read:admin].

@jrchamp
Copy link
Collaborator

jrchamp commented Aug 15, 2024

All of the Dashboard API endpoints start with metrics/. So it's trying to make a request to an endpoint that claims that it needs a dashboard scope. Either the plugin is incorrectly making a Dashboard API call even though the Dashboard scopes are gone or the API is returning incorrect information.

Here's my hopeful guess: Maybe the scopes were cached and the cache wasn't cleared when the Marketplace app was updated. If it's working now, that's the most likely explanation, because the cache should have automatically expired by now.

Are you still getting the same error? If so, then someone will need to enumerate all of the API calls that might be made and verify that Zoom's API is checking the correct set of scopes.

@jwalits
Copy link
Contributor Author

jwalits commented Aug 21, 2024

Hey @jrchamp

Apologies for the delay in getting back to you. I haven't had a chance to re-check that in the last few days. I actually disabled that task for now on the site - as it wasn't really needed and kept pinging our monitoring creating an alert.

I'll re-check hopefully in the next few days to see if its still happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information needed Need more information from user
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants