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

Explain relationship between Error "Stopped mid run, likely due to the background process being killed" and OAuth expiring #82

Open
theship opened this issue May 10, 2024 · 0 comments

Comments

@theship
Copy link

theship commented May 10, 2024

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:

  1. 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.
  2. 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.
  3. When the button changes to Authenticate with Google Drive, click on it to step through the OAuth flow again.
  4. Add connectors back to start indexing again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant