Hi there!
A while back, I set-up our Moodle 3.3.7 site with Google Drive's document converter via the Google Cloud Platform and it worked pretty dandily until a few days ago where a teacher reported that the AnnotatePDF stopped converting the non-PDF files for them to annotate and grade. I haven't changed any configurations in Moodle or Google Cloud Platform that would indicate an issue. I've performed the below troubleshooting steps and still cannot get the documents to convert (primarily MS Office files):
- Ensured the service account is connected to the Google Cloud Platform in Moodle (/admin/tool/oauth2/issuers.php). This Moodle site only uses the Google OAuth2 service to convert MS Office files for the AnnotatePDF function, so no "Allow Login" functionality necessary. Moodle agrees that the Google Oauth 2 service is correctly configured and discovery is OK. Just to be sure, I reconnected the account to the Google account that the Drive API is configured:
Note: I noticed that despite my Google oauth2 service being enabled as per the screenshot below, this does not show up in the Site Administration block under Site Administration > Server > Oauth 2 Services, where it did when I initially set up the converter. - Ensured the client ID and shared secret in the Google oauth service page () match the Oauth2.0 client ID in the created Client ID for Web Application in the Google Cloud Platform (APIs & Services > Credentials > select the ClientID (I only have 1 entry on this page). I left these as-is when I created the service earlier in the year (and it worked then).
- Ensured the scopes mentioned in the above screenshot match those in Google Cloud platform.
- Ensured the Moodle site is authorised in the ClientID's settings > Authorized redirect URIs (https://my-moodle.site.com/admin/oauth2callback.php).
- Ghostscript path is valid in /admin/settings.php?section=systempaths and the passes the "test ghostscript path" function (mod/assign/feedback/editpdf/testgs.php).
- Ensured the Google Drive API is enabled in Google Cloud Platform. According to the Moodle documentation, this interaction between Moodle and google cloud doesn't require account verification to convert the files (according to here).
- Check that the Google Drive document converter is enabled and configured as the Oauth2 Service.
- Test the Google Drive document conversion (/files/converter/googledrive/test.php)
This is where I saw an explicit issue with the converter. The test.php page returns "This document converter is configured properly", but the "Test document conversion" function generates an invalid PDF.
In Firefox, it doesn't load the PDF in the browser (/files/converter/googledrive/test.php?sendpdf=1&sesskey=REDACTED_FOR_OBVIOUS_REASONS) and asks if you want to open it in a different viewer (my default viewer is Adobe Acrobat reader):
In Chrome:
In Acrobat:
In an assignment in the AnnotatePDF feature (/mod/assign/view.php?id=somenumber&action=grader). Sections of the page redacted for student privacy.