You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After one hour get INFO:oauth2client.client:access_token is expired, but requests keep working #72
@mozboz also, do you see it happening once an hour per thread or after an hour it keeps doing this per request, again and again? Does it print the same token_expiry: 2020-12-17 23:06:32.235919 date?
I have same issue.
authentication code as below. I can upload files after authentication, but one hour later access token was expired with same message "oauth2client.client: access_token is expired. Now: 2022-01-26 04:09:30.270165, token_expiry: 2022-01-26 04:09:29.818932'.
Even though using Service Account Credential, oauth2client try to renew access token with client secret.
Traceback (most recent call last):
File "/home/kyamada/work/crawler/lib64/python3.7/site-packages/oauth2client/clientsecrets.py", line 121, in _loadfile
with open(filename, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'client_secrets.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kyamada/work/crawler/lib64/python3.7/site-packages/pydrive2/auth.py", line 442, in LoadClientConfigFile
client_config_file
File "/home/kyamada/work/crawler/lib64/python3.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/home/kyamada/work/crawler/lib64/python3.7/site-packages/oauth2client/clientsecrets.py", line 125, in _loadfile
exc.strerror, exc.errno)
oauth2client.clientsecrets.InvalidClientSecretsError: ('Error opening file', 'client_secrets.json', 'No such file or directory', 2)
I only took a quick look at the code.
If "auth_method" is "service" and the access token was expired, it looks ServiceAuth function is called.
ServiceAuth function try to get value of "client_json_file_path" to get the credential info again, but "client_json_file_path" is not include SERVICE_CONFIG_LIST and I guess there is no way to set value of "client_json_file_path".
This is still absolutely a problem. Just encountered it now. Any workarounds? The other login method for PyDrive2 (with client secrets et al.) is way too complex and overkill for what I need to do, and to my experience the credential renewals are super error-prone/requiring a sign in via browser every few days (courtesy of Google I guess).
The repeated oauth2client.client message came from the old authentication library. On main, #395 uses google-auth and coordinates token refreshes for workers sharing a credential file. The PR verified that four processes sharing an expired cache made one refresh request and reused the rotated token. This change is pending release.
Activity
shcheklein commentedon Dec 28, 2020
@mozboz could you please share a bit of your code please? How do authentication (once? every time you run it? from a file?).
shcheklein commentedon Dec 28, 2020
@mozboz also, do you see it happening once an hour per thread or after an hour it keeps doing this per request, again and again? Does it print the same
token_expiry: 2020-12-17 23:06:32.235919date?melito00 commentedon Jan 26, 2022
I have same issue.
authentication code as below. I can upload files after authentication, but one hour later access token was expired with same message "oauth2client.client: access_token is expired. Now: 2022-01-26 04:09:30.270165, token_expiry: 2022-01-26 04:09:29.818932'.
Even though using Service Account Credential, oauth2client try to renew access token with client secret.
melito00 commentedon Jan 26, 2022
I only took a quick look at the code.
If "auth_method" is "service" and the access token was expired, it looks ServiceAuth function is called.
ServiceAuth function try to get value of "client_json_file_path" to get the credential info again, but "client_json_file_path" is not include SERVICE_CONFIG_LIST and I guess there is no way to set value of "client_json_file_path".
shcheklein commentedon Jul 24, 2022
Closing as stale
TheManchineel commentedon Jul 28, 2022
This is still absolutely a problem. Just encountered it now. Any workarounds? The other login method for PyDrive2 (with client secrets et al.) is way too complex and overkill for what I need to do, and to my experience the credential renewals are super error-prone/requiring a sign in via browser every few days (courtesy of Google I guess).
shcheklein commentedon Jul 29, 2022
@TheManchineel could you share the error one more time please? And your config, how do you setup it?
does it happen after you run it for one hour+ or right after you launch it?
shcheklein commentedon Nov 21, 2026
The repeated
oauth2client.clientmessage came from the old authentication library. Onmain, #395 usesgoogle-authand coordinates token refreshes for workers sharing a credential file. The PR verified that four processes sharing an expired cache made one refresh request and reused the rotated token. This change is pending release.