-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Add docs on re-authenticating with GDrive OAuth
Setting up Google Drive OAuth is tricky, and the docs do a good job of walking through it. But there is no indication that the OAuth creds expire in 7 days, at which time you must pause and delete all connections, and revoke access in order to trigger re-auth.
Maybe some details after the Indexing section would be useful. May I suggest something like the attached new section at the bottom of the Google Drive OAuth page? Or maybe this sort of thing should go in some Errors or Troubleshooting section.
Suggested new content
Revalidating your OAuth credentials with Danswer
In test mode, your OAuth credentials expire after seven (7) days. This means you must revalidate your Google Drive credentials with Danswer every week. To trigger token refresh and reset, go through the OAuth consent screen again.
What to look for
If you see the following error message in a connector log (for example: http://localhost:3000/admin/connector/<connector_id>), it may be that your Google Drive credentials have expired.
Stopped mid run, likely due to the background process being killed
Docker or Kubernetes logs may give some indication that your OAuth credentials have expired. For example, if you run the following docker command:
docker exec -it danswer-stack-background-1 cat /var/log/update.log | grep -v 'new indexing tasks\|current UTC time'You may see the following error message:
PermissionError: Unable to access Google Drive - unknown credential structure.
What steps to take
When AUTH_TYPE=disabled, "Revoke Access" only works after deleting all of the Google Drive connectors along with their indexed files. This means that you must pause and delete any Google Drive connectors. After you reauthenticate, you can add connectors back to start indexing again.
To re-authenticate with Google Drive, follow these steps:
- Navigate to the Admin Dashboard and select each Google Drive Connector (for example: http://localhost:3000/admin/connector/<connector_id>).
- Pause the connector if it is running.
- Select the "Schedule for Deletion" button.
When the connector is deleted, you see an error that the connection can't be found. At this point, the indexed files are also deleted. This is why you must reindex the files after re-authentication. - Repeat this pause|delete step for each connector.
- Go back to the Google Drive Connector page (for example: http://localhost:3000/admin/connectors/google-drive) and click on Revoke Access to remove the stale OAuth credentials.
- When the button changes to Authenticate with Google Drive, click on it to step through the OAuth flow again.
- Add connectors back to start indexing again.