cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

"There was a problem updating your calendar" with bookings onto Google Calendar

Open aspiers opened this issue 3 years ago • 4 comments

When people request a booking from one of my event pages, I receive emails containing the following:

image

This is a relatively new issue, probably appearing sometime in the last 2 weeks or less.

I have noticed one thing which may yield a clue to the cause of this issue:

Until the other day, I had 3 Google Calendar accounts connected, and each time this happened, I was always receiving two emails with the above error text, plus one email successfully confirming the booking. And sure enough, the booking appeared in the right Google Calendar. So I thought "that's interesting, I always receive two failure emails plus one success email, and 2+1 == 3, so I wonder if that's related to the fact that I have 3 calendars connected".

To test this hypothesis I connected a fourth Google account which I happen to own (but seldom use). And guess what, now I am receiving three failure emails plus one success email!

So it suggests to me that your backend code is erroneously iterating over all connected calendars, trying to schedule on each, and it only succeeds on the one where it is supposed to succeed. Could that explain this bug? If so, of course instead it should only attempt to schedule on the one correct calendar, and not on the others.

Steps to Reproduce

  1. Connect multiple Google accounts.
  2. Get someone to book an event using an event type which books onto one of those calendars.
  3. Observe the emails with errors.

aspiers avatar Aug 04 '22 19:08 aspiers

@joeauyeung

PeerRich avatar Aug 05 '22 09:08 PeerRich

@aspiers Hey just to make sure, in what version do you see this error? Or are you self-hosted? The error you mentioned happens when a destinationCalendar it's missing his credentialId, so as last resort we iterate event creation on all calendars that exist on Credential with the same type. I think we receive 404 since destinationCalendar.externalId doesn't exist in every connected calendar. We just updated CalendarManager so when a 404 it's received there shouldn't trigger failure email on this case.

https://github.com/calcom/cal.com/blob/f589d06ed4c423c17093ddb93a9e9f0b96aebcb3/packages/core/CalendarManager.ts#L162-L176

I think we still might investigate why destinationCalendar.credentialId it's null on certain cases. @joeauyeung

alannnc avatar Aug 05 '22 15:08 alannnc

I'm using the hosted service not self hosted. Feel free to dig into my account if that helps figure it out. One thing to note is that my cal.com account address is different from the email of all my connected Google accounts.

aspiers avatar Aug 05 '22 17:08 aspiers

And BTW what exactly are credentialId and externalId? Are they email addresses, or auth tokens, or internal Google user ids, or something else? Can I help debug this somehow?

aspiers avatar Aug 07 '22 10:08 aspiers

i dont think this is happening anymore

PeerRich avatar Jan 25 '23 16:01 PeerRich