Sync Google - Mail / Calendar failed
Hello all ! This is probably common , but I have set up Google with internal oAuth app with what I think is the right scope (6 of them) - authentication with Google works fine.
However adding the Google account throws in the console, bit of a weird exception for operation GetCurrentUser (attached a screenshot). I have previously seen that this should be normal, but with a very brief explanation.
Could you please help ?
11 Replies
I think this is unrelated, this error is triggered when users are not logged in on Twenty. It should not be thrown but does not have any impact on Twenty behavior
That doesn't seem to be the case as this exception tracks back to when I am already logged in with Google account connection and I try to add the same account to connect to email/calendar for the updates.
Unfortunately the sync comes back as failed with no other exceptions
I did reset everything through
npx nx database:reset
as well but sync is still going wild and the only exception is "Forbidden resource" without much informationis your worker running? If yes, could you share the logs from your worker?
also, what is your messageChannel status in db? FAILED_UNKNOWN or FAILED_INSUFFICIENT_PERMISSIONS?
It is running - the worker , messageChannel was indeed - FAILED_INSUFFICIENT_PERMISSIONS.
Ok, so either there is an issue with your Google oAuth screen setup, either there is an issue with your env variables not pointing to your Google oAuth setup, either there is an issue with the Gmail Account you are trying to connect
Could you share your Google oAuth scopes from GoogleConsole?
It should look like this:
(except from gmail.send that you don't need)
(sorry for the french)
@Cv3 I just worked through the same problem, happy to compare configs
For me, I had to add Google People API, Google Calendar API, and GMail API scopes, then everything worked.
In my case, i enabled calendar sync, but didnt add api scopes on google cloud for calendar, so all sync tasks failed with the same error you got until i added the calendar scopes.
Well that screenshot helped, thank you both tho. I have figured that adding scopes without enabling the APIs might not have been my brightest idea. I haven't worked through the Google ecosystem for quite a while and completely missed that.
Really appreciate the help!
Wonderful 🙂
This will help future self hosters too