T
Twenty7mo ago
Licardo7

Gmail sync failed

Each time i connect my account to gmail, it appears as "Sync failed". I have the google console system set up, it's on test mode to take requests from my company's emails, and I have the following variables in my environments: The company, password, and secret information is made up for obvious reasons - but it's the correct info (at least I think!)
MESSAGING_PROVIDER_GMAIL_ENABLED=TRUE
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
FRONT_AUTH_CALLBACK_URL=https://21.company.com/verify
AUTH_PASSWORD_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxxxxxxxxx.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=xxxxxxxxxx
AUTH_GOOGLE_CALLBACK_URL=https://21.company.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://21.company.com/auth/google-apis/get-access-token
IS_SIGN_UP_DISABLED=false
EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SERVER_PORT=465
EMAIL_SERVER_PASSWORD='generated-app-password'
MESSAGING_PROVIDER_GMAIL_ENABLED=TRUE
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
FRONT_AUTH_CALLBACK_URL=https://21.company.com/verify
AUTH_PASSWORD_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxxxxxxxxx.apps.googleusercontent.com
AUTH_GOOGLE_CLIENT_SECRET=xxxxxxxxxx
AUTH_GOOGLE_CALLBACK_URL=https://21.company.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://21.company.com/auth/google-apis/get-access-token
IS_SIGN_UP_DISABLED=false
EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SERVER_PORT=465
EMAIL_SERVER_PASSWORD='generated-app-password'
I'm running Twenty on a Dockge container on my Proxmox sever. It gives me the following errors:
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GoogleCalendarSyncJob] Error refreshing access token for connected account xxxxxxxxxxxxxxxxxxxxxxxxxxxx in workspace yyyyyyyyyyyyyyyyyyyyyyyy
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GoogleCalendarSyncJob] Error: Error refreshing access token: Request failed with status code 400
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GmailFullMessageListFetchJob] Error refreshing access token for connected account xxxxxxxxxxxxxxxxxxxxxxxxxxxx in workspace yyyyyyyyyyyyyyyyyyyyyyyy
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GmailFullMessageListFetchJob] Error: Error refreshing access token: Request failed with status code 400
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GoogleCalendarSyncJob] Error refreshing access token for connected account xxxxxxxxxxxxxxxxxxxxxxxxxxxx in workspace yyyyyyyyyyyyyyyyyyyyyyyy
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GoogleCalendarSyncJob] Error: Error refreshing access token: Request failed with status code 400
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GmailFullMessageListFetchJob] Error refreshing access token for connected account xxxxxxxxxxxxxxxxxxxxxxxxxxxx in workspace yyyyyyyyyyyyyyyyyyyyyyyy
twenty-worker-1 | [Nest] 34 - 06/05/2024, 10:07:35 PM ERROR [GmailFullMessageListFetchJob] Error: Error refreshing access token: Request failed with status code 400
I feel like it's an easy fix but I can't figure out what's going on. Please let me know if you need other info!
4 Replies
Licardo7
Licardo7OP7mo ago
The integration goes through the google sign in screen just fine, and redirects back to my Twenty app, but we just get "Failed" on Google Cal, and "Not Synced" on the Gmail
Weiko
Weiko7mo ago
Hi @Licardo7, if you want to debug a bit I would setup a breakpoint or logs inside GoogleAPIRefreshAccessTokenService. You are most likely not sending a correct payload to google. Unfortunately the google API response is not always very explicit. Could be your client_id or client_secret 🤔
Licardo7
Licardo7OP7mo ago
gotcha, i'll try it I'm running the docker container though, I'm guessing I'll have to just debug on the bare metal instance to get logs right?
Weiko
Weiko6mo ago
Yes, in this case you'll probably need to run twenty in dev mode
Want results from more Discord servers?
Add your server