T
Twenty2mo ago
Cv3

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 ?
No description
11 Replies
charles
charles2mo ago
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
Cv3
Cv3OP2mo ago
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
No description
Cv3
Cv3OP2mo ago
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 information
No description
charles
charles2mo ago
is 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?
Cv3
Cv3OP2mo ago
It is running - the worker , messageChannel was indeed - FAILED_INSUFFICIENT_PERMISSIONS.
charles
charles2mo ago
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?
charles
charles2mo ago
It should look like this: (except from gmail.send that you don't need)
No description
charles
charles2mo ago
(sorry for the french)
Jeremy
Jeremy2mo ago
@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.
Cv3
Cv3OP2mo ago
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!
charles
charles2mo ago
Wonderful 🙂 This will help future self hosters too
Want results from more Discord servers?
Add your server