-
Notifications
You must be signed in to change notification settings - Fork 146
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
Token refresh does not work #627
Comments
It seems there was an attempt to fix the problem in #486, but it was unsuccessful. |
To refresh the token, we are calling the following sequence of methods on each request:
My suspicion is that |
It happens only if provide def get_storage_options():
# It works, but I don't know if it's the best way to do it
#
# Also, seems like need to specify the scope, although worked before.
# Source: https://stackoverflow.com/questions/60401040/getting-invalid-scope-when-attempting-to-obtain-a-refresh-token-via-the-google-a
credentials, _ = google.auth.default(
scopes=["https://www.googleapis.com/auth/cloud-platform"]
)
if not credentials.valid:
credentials.refresh(Request())
return {
"token": credentials.token,
}
pd.read_parquet(..., storage_options=get_storage_options()) Relying on any other auth method fixes the problem. |
The problem is related to #32. Unfortunately, it is not obvious to implement token refresh when a library is used by another library (dask -> pyarrow -> fsspec -> gcsfs). It would be amazing to implement more prone token refresh.
Here is an exception that we get when the job runs longer than an hour:
gcsfs version is
2023.12.2.post1
HttpError: Invalid Credentials, 401
The text was updated successfully, but these errors were encountered: