Find answers from the community

s
F
Y
a
P
Updated last month

is everything ok with googledrivereader

is everything ok with googledrivereader? because in january i use my credentials.json and everything is ok, now i run the same code and have this error:
raise ValueError("Client secrets must be for a web or installed app.") ValueError: Client secrets must be for a web or installed app.
1
N
h
L
10 comments
Can you share the full traceback?
sure, here:
Traceback (most recent call last):
File "D:\heloi\macall_rag\excluir.py", line 4, in <module>
red = reader.load_data(id)
File "C:\Users\heloi\anaconda3\envs\macall_rag_libs\lib\site-packages\llama_index\readers\google\drive\base.py", line 519, in load_data
self._creds = self._get_credentials()
File "C:\Users\heloi\anaconda3\envs\macall_rag_libs\lib\site-packages\llama_index\readers\google\drive\base.py", line 178, in _get_credentials
flow = InstalledAppFlow.from_client_config(self.client_config, SCOPES)
File "C:\Users\heloi\anaconda3\envs\macall_rag_libs\lib\site-packages\google_auth_oauthlib\flow.py", line 159, in from_client_config
raise ValueError("Client secrets must be for a web or installed app.")
ValueError: Client secrets must be for a web or installed app.
Based on the traceback it feels that its something to do with your credentials or on google console side. i would redownload fresh credentials and try again
@Nehil can you tell me what json structure of credential.json? I just created a service account, as requested, but I think the json fields are not necessary. my new error is:
Attachment
image.png
my credentials.json:
{
"type": "service_account",
"project_id": "",
"private_key_id": ",
"private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n",
"client_email": "",
"client_id": "",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "",
"universe_domain": "googleapis.com"
}
My friend tried it too and is having this:
Attachment
Imagem_do_WhatsApp_de_2024-05-16_as_17.20.10_8235ec62.jpg
@Logan M can u help me?
Google credentials are a nightmare. I don't think I know the solution here. Probably best to just read the source code and figure what it's doing and what you are missing
Add a reply
Sign up and join the conversation on Discord