-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Intermittent Gmail Sync Failures #12336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am still seeing this behavior and only seeing the following message: is there a chance that this error is users quite literally having some email in which the subject/body/metadata has invalid characters/something which breaks a data model? Also if there is anything else i can provide here with more detail please let me know. |
I have been able to reproduce this error on the twenty SAAS offering (ie not self hosted). @Bonapara I think this would make more sense to be tagged as bug. |
to answer your question about rate limiting: this can happen if you have mulitple apps that try to sync your emails at the same time. For instance if you sync your email from the twenty cloud (https://app.twenty.com/) and at the same time on your local instance (http://localhost:4200/) then you might end up this way. Note that if you try to sync at the same time with other apps using n8n or any other sync, it does not help. This issue we saw in the past does not really affect us anylonger, but you can have a look at vars in the codebase like |
I am very interested in the second bug you noticed "MessageImportException [Error]: Invalid email format" The best would be if you could reproduce the issue and find exactly the email that causes the problem !!! |
@guillim So i am still seeing an occasional concurrent rate limits nothing else (in my control) is happening to a users inbox a time of sync. (ie no local deployments, other workflows, etc.) but we can leave that be for now. Please see my PR: #12383 I believe this issue was a result of addressparser choking on on certain email addresses that may be malformed per their rulesets. When it came across something it considered malformed it threw an exception and killed the MessagingMessagesImportService process. The PR creates a "safeParseAddress" function that will gracefully catch those errors and hopefully not kill off the entire MessagingMessagesImportService process but rather just not import any emails it deems invalid. I have built the image from source and deployed it to my self hosted twenty and it appears to be working for the first couple thousand emails in my first test inbox but i am still conducting testing on a few different inboxes. |
Good PR. I would like to reproduce locally, so can you give me examples of wrongly typed emails that addressparser throws as errors ? |
I have only really found this with real world usage of inbox syncs that i am unable to do locally/unable to provide logs for. But here are some theoretical cases that might be decent to eval against:
|
I will take over from now on if you don't mind @mdvertola ! This way it will follow what we already did on microsoft sanitization |
FYI : this Will be merged today Fixed by #12383 |
I believe that some emails with invalid characters are breaking the sync process. this PR attempts to create a "safeParseAddress" function. Hopefully this will change current behavior of a single email breaking the entire sync process to the sync process "skipping" an invalid email address and continuing on. I opened this because of issues explained in #12336 --------- Co-authored-by: guillim <[email protected]>
I believe that some emails with invalid characters are breaking the sync process. this PR attempts to create a "safeParseAddress" function. Hopefully this will change current behavior of a single email breaking the entire sync process to the sync process "skipping" an invalid email address and continuing on. I opened this because of issues explained in twentyhq#12336 --------- Co-authored-by: guillim <[email protected]>
Thanks for your contribution @mdvertola ! |
Bug Description
I have a self hosted deployment running v0.54. It currently has about ~10k contacts with around ~8k companies. These were all imported via the gmail sync.
I have about 5 users who have imported their gmail accounts into it. 3 users are reporting a several hour stint of email in a 'syncing' state. During that time we seem to import 300-1k emails/companies but eventually end up failing. But on the other hand we do have some users who were able to successfully import 6-7k contacts/companies without any issue.
My deployment uses aws ECS with one server container, one worker container, aws redis and aws postgres. No services/dbs are resource constrained during these syncs.
I see two error messages in the worker node:
I assume we first hit the too many concurrent requests then that gets followed by an invalid (ie undefined) format since the import got rate limited. I read through the self hosting docs here: https://twenty.com/developers/section/self-hosting/setup Are there any ways (that aren't documented) to adjust/change this rate limit?
If there is not a way to adjust this on the twenty side, I can likely adjust the google settings to open up rate limits. Can someone provide an estimate to the rate at which twenty call the gmail api provider during a sync for a single account? Also if any insight can be provided to that rate on multiple accounts at one time it would be helpful as well.
Generally it may also be worth looking into doing some sort of backoff/better error handing in the case that the rate limit is hit.
The text was updated successfully, but these errors were encountered: