T
Twenty2mo ago
hassaanz

Email sync failed - self hosted

Hi everyone. I did a self host of Twenty and tried setting up email sync. But it's giving me error "sync failed" however, I see people and companies creates out of my email account. Is there a way to debug the sync jobs? Running everything in a docker-compose.
24 Replies
ɃØĦɆᵾS
ɃØĦɆᵾS2mo ago
@Guillaume could you take a look?
Guillaume
Guillaume2mo ago
Hi @hassaanz , Thanks for setting up Twenty. Did you launch the worker app ? they are the one repsonsible of treating emails. My bad, if you see people created from your emails it means workers are on and working. If you look at the worker logs, do you see any errors ? Also make sure you are using the latest version of twenty since we did a coupld of fix that are available on the main branch
Jas0r
Jas0r2mo ago
Hi, I am getting the same error, email is syncing for about 1-2 days before hitting a sync failed. Is there a way to restart or can you only remove the account and start again? I have some logs but there is a lot of personal data in them. Let me know what you require and can send in
Guillaume
Guillaume2mo ago
are you o microsoft of google guys ?
Jas0r
Jas0r2mo ago
Microsoft
Guillaume
Guillaume2mo ago
ok. we are aware of a bug. right now working on it. I'll keep you in touch in the coming days
Jas0r
Jas0r2mo ago
Excellent thanks
hassaanz
hassaanzOP2mo ago
Hi. Sorry for the late reply. I tried to update to the latest version. I have my worker app running. There are some emails synced but it seems like the job is stuck in between. The admin panel health status shows everything is working fine. For some reason the calendar sync seems to be working but the emails are not being synced
No description
Sonntagsgebet
Sonntagsgebet2mo ago
Hey everybody 🙂 I'm hosting Twenty on a Digital Ocean VPS and everything works fine, except of the mail sync. I'm trying to sync google workspace mails and it directly throws an error. Do you have any troubleshooting guidance for me? I'm running out of ideas. I've also not found where I could see this fancy dashboard for syned mails. Would really appreciate the help as I can then test Twenty fully! Cheers
No description
Pierre Rama
Pierre Rama2mo ago
Hi mine says "importing" but i see no contact updated with mails. Vps is a Digital Ocean
Guillaume
Guillaume2mo ago
Guys, can you share your Twenty version, and appropriate error logs if possible ?
Sonntagsgebet
Sonntagsgebet2mo ago
Hey Guillaume, thanks for reaching out. I'm on version 0.44.14 and have sent you the erorr logs in a private chat. Really curious to solve the error
hismayilov
hismayilov4w ago
exactly same
Jas0r
Jas0r4w ago
Yeah, I have removed the account and tried again but same occurs after a few days. I am also on the latest version 0.5 and seems to still be an issue. @Guillaume did indicate they are aware of this and working on it. Im just running without the sync until its fixed. Hopefully there is an option to resume a failed sync in coming versions
Guillaume
Guillaume4w ago
Can I ask you guys if you saw some error in the logs ? Or anything more specific that could help for the debugging ? We released last week a couple fix, but I think I am missing one
Jas0r
Jas0r4w ago
Hi, just PM'ed you a log. I have updated to V0.50.5, I will remove the email and er-add to start syncing again and keep you posted
soundworker2003
same error, version 0.43.0 , google sync failed 2weeks ago, tried removing and adding gmail account from settings but not work. here is worker container log. @Guillaume
Guillaume
Guillaume4w ago
Ok. thanks for sharing. An unkown error, very detailed logs, it's gonna be easy... Screw me, I should add more details when logging these type of errors lol. Love it 🙂
hismayilov
hismayilov4w ago
Is there anyway to force sync ? after first sync now it is in status of "Sync failed". I already aplied as here https://twenty.com/developers/section/self-hosting/setup#for-gmail-and-google-calendar
Luffer
Luffer4w ago
Hi everyone, I’m experiencing the same issue. Everything works well except for email and calendar syncing. I’m using v0.50.2 and have attached some logs that may be helpful. These logs were generated when I attempted to re-add the email accounts in the CRM, and I’ve hidden the email addresses in the logs.
Guillaume
Guillaume4w ago
Hi guys, Thanks for sharing your logs, it's very helpful for us to understand where the issue may come from. On my side, I pursue the investigation this week. Also I added more logs since we are a bit blind to be honest. What to do if you are stuck in Sync failed : - best option is to open the database, find your table "MessageChannel", find your email in that table. - Then you should see FAILED and FAILED_UNKNON in the columns. You can chage these values to PARTIAL_MESSAGE_LIST_FETCH_PENDING and ACTIVE - Note : you might need to reproduce the same steps for the "calendarChannel" table in case your calendar sync failed as well A quick update : - we fixed this issue yesterday. I will be in the next release. - we fixed this issue Old fixes already implemented in the codebase : - Microsoft concurrency error Special ping to @hismayilov
GitHub
Fix-messaging-calendar-issues by guillim · Pull Request #11424 · ...
fixing Event Calendar bug due to TypeORM limitations avoid systematic crash on contact creation jobs, simply logging
GitHub
datasource TTL fix by guillim · Pull Request #11444 · twentyhq/tw...
Comparing the last date a datasource was used instead of a fixed TTL : should fix workers issues "error: Error: Connection terminated"
Guillaume
Guillaume4w ago
About your subject, I see in your logs that your token is invalid "Access token is undefined or empty" so make sure you have a microsoft 365 licence. Microsoft does not let free users to use their API
soundworker2003
Thanks. It starts to sync now. I found two rows in table "messageChannel". Both were marked as 'FAILED'. The 1st one's update time is about 1 month ago. The 2nd one is a few days ago when I tried to remove and re-add gmail account. I removed the newer row. And changed the older row as you described. Then it started to sync.
Guillaume
Guillaume3w ago
Great job.

Did you find this page helpful?