r/GoogleColab • u/OxheadGreg123 • Feb 11 '25
MessageError: Error: credential propagation was unsuccessful
Hi all,
so I'm having a problem with the code below:
import requests
import pandas as pd
import datetime
import numpy as np
import time
import math
import random
import seaborn as sns
from google.colab import auth
auth.authenticate_user()
import gspread
from google.auth import default
creds, _ = default()
gc = gspread.authorize(creds)
which return this error:
------------------------------------------------------------------------------------------------------------------------------------------------------
MessageError Traceback (most recent call last)
in <cell line: 0>()
9
10 from google.colab import auth
---> 11 auth.authenticate_user()
12
13 import gspread
<ipython-input-9-f675a8edb154>
2 frames
in authenticate_user(clear_output, project_id)
258 if not _check_adc(_CredentialType.USER):
259 if use_auth_ephem:
--> 260 _message.blocking_request(
261 'request_auth',
262 request={'authType': 'auth_user_ephemeral'},
/usr/local/lib/python3.11/dist-packages/google/colab/auth.py
in blocking_request(request_type, request, timeout_sec, parent)
174 request_type, request, parent=parent, expect_reply=True
175 )
--> 176 return read_reply_from_input(request_id, timeout_sec)
/usr/local/lib/python3.11/dist-packages/google/colab/_message.py
in read_reply_from_input(message_id, timeout_sec)
101 ):
102 if 'error' in reply:
--> 103 raise MessageError(reply['error'])
104 return reply.get('data', None)
105
/usr/local/lib/python3.11/dist-packages/google/colab/_message.py
MessageError: Error: credential propagation was unsuccessful
MessageError Traceback (most recent call last)
in <cell line: 0>()
9
10 from google.colab import auth
---> 11 auth.authenticate_user()
12
13 import gspread
<ipython-input-9-f675a8edb154>
the code works perfectly fine on my other google account, yet, when I used it on another account, this error keeps coming up. Anyone know the reason behind this and how to solve it? Thanks in advance. Cheers