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
I had lieer working great a few months ago using my own Google Cloud project and OAuth 2.0 Client ID, then stopped using it for no good reason. I just came back to it now and started seeing this:
$ gmi sync -v
Traceback (most recent call last):
File "/home/adam/.local/bin/gmi", line 24, in <module>
g.main ()
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/lieer/gmailieer.py", line 419, in main
args.func(args)
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/lieer/gmailieer.py", line 499, in sync
self.remote.get_labels()
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/lieer/remote.py", line 140, in func_wrap
self.authorize()
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/lieer/remote.py", line 497, in authorize
self.credentials = self.__get_credentials__()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/lieer/remote.py", line 552, in __get_credentials__
credentials.refresh(Request())
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/google/oauth2/credentials.py", line 409, in refresh
) = reauth.refresh_grant(
^^^^^^^^^^^^^^^^^^^^^
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/google/oauth2/reauth.py", line 366, in refresh_grant
_client._handle_error_response(response_data, retryable_error)
File "/home/adam/.local/share/pipx/venvs/lieer/lib64/python3.11/site-packages/google/oauth2/_client.py", line 68, in _handle_error_response
raise exceptions.RefreshError(
google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})
I got it working after doing both of the following, although it's possible that only one of them was required and I'm not sure which:
Adding my gmail account as a test user to the GCP project
Running gmi auth -v -f and (re-?)agreeing to give the project the required permissions to my gmail account
I had initially tried creating a new OAuth 2.0 Client ID in the same project and then running gmi auth -v -c client_secret_*.apps.googleusercontent.com.json but this didn't work, so then I tried replacing the -c switch with -f and it worked. I'm not sure if this has resulted in using the new client ID or not.
Anyway, hope this helps someone. It would be great if this was documented on the website.
The text was updated successfully, but these errors were encountered:
I had lieer working great a few months ago using my own Google Cloud project and OAuth 2.0 Client ID, then stopped using it for no good reason. I just came back to it now and started seeing this:
I got it working after doing both of the following, although it's possible that only one of them was required and I'm not sure which:
gmi auth -v -f
and (re-?)agreeing to give the project the required permissions to my gmail accountI had initially tried creating a new OAuth 2.0 Client ID in the same project and then running
gmi auth -v -c client_secret_*.apps.googleusercontent.com.json
but this didn't work, so then I tried replacing the-c
switch with-f
and it worked. I'm not sure if this has resulted in using the new client ID or not.Anyway, hope this helps someone. It would be great if this was documented on the website.
The text was updated successfully, but these errors were encountered: