run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
36k stars 5.12k forks source link

[Bug]: `redirect_uri_mismatch` in GoogleDocsReader #16326

Open xwind-h opened 1 week ago

xwind-h commented 1 week ago

Bug Description

GoogleDocsReader uses port=0 to run local server:creds = flow.run_local_server(port=0)

but the redirect uri is set to http://localhost:8080/ (mentioned in the document)

image

I think the code should be:creds = flow.run_local_server(port=8080)

Version

0.11.11

Steps to Reproduce

  1. follow the steps in google reader document, set redirect uri to http://localhost:8080/ image
  2. run the code GoogleDocsReader().load_data(document_ids=['xxx'])

Relevant Logs/Tracbacks

No response

dosubot[bot] commented 1 week ago

Hey @xwind-h! I'm here to help you with any bugs, questions, or contributions you have for GoogleDocsReader. Let's tackle this together!

The issue you're encountering with the redirect_uri_mismatch error in the GoogleDocsReader class is due to a mismatch between the port used in the code and the port specified in the redirect URI. The code uses port=0, which allows the operating system to select an available port automatically, while the redirect URI is set to http://localhost:8080/ in the documentation.

To resolve this, you should modify the code to use port=8080 to match the redirect URI specified in your Google Cloud Console settings. Update the line in your code to:

creds = flow.run_local_server(port=8080)

This change should align the port used by the local server with the one specified in the redirect URI, resolving the mismatch error.

To continue talking to Dosu, mention @dosu.