phw198 / OutlookGoogleCalendarSync

Sync your Outlook and Google calendars
https://www.outlookgooglecalendarsync.com/
Mozilla Public License 2.0
1.8k stars 215 forks source link

Auto-generated Events from Gmail: Updated event failed to save. Bad Request [400=BadRequest] #1919

Open paulwinton opened 1 month ago

paulwinton commented 1 month ago

Hi I've been using OGCS for ~5 years. Has always worked fine. Recently Its not updating the Google side for some reason. To my knoweldge nothing has changed. Message in red is....

Updated event failed to save. Bad Request [400=BadRequest]

Error screen below

I looked for FAQ or errors on this but couldn't find any. I'm not especially web tech literate (e.g. what even is a proxy server?) but am technically competent so fit-for-purpose suggestions much appreciated.

Thanks for any suggestions.

P

Sync version: 2.10.0.0

Profile: Default

Sync started at 28/07/2024 12:55:15 pm

Syncing from 21/07/2024 to 27/09/2024

Outlook ↔ Google

Finding Calendar Entries
Scanning Outlook calendar...

27 Outlook calendar entries found.

Scanning Google calendar...

Authenticating with Google
Preparing to authenticate with Google.
Handshake successful.
20 Google calendar entries found.

1 are exceptions to recurring events.

Total inc. recurring items spanning sync date range...
Outlook 22, Google 20
Checking for orphaned Google items

Syncing Outlook → Google
Matching calendar items...

0 Google calendar entries to be deleted.

0 Google calendar entries to be created.

20 calendar entries to be compared.

Comparing 20 existing Google calendar entries

Updated event failed to save.
Bad Request [400=BadRequest]

Sync aborted after 1 failed attempts!
JonDBl commented 1 month ago

I Have been getting the same issue.

Log attached.

I believe it is entries inserted from 3rd part sites (In my case Flight details from Easyjet and Aer Lingus) OGcalsync.log

ybroudo commented 1 month ago

I have the same issue and it does seems to come from a 3rd party creating flight or Booking.com events in my google calendar

the solution I have found is to open the event in google calendar and mark it as Default visibility https://support.google.com/calendar/answer/34580?visit_id=638579552194347502-3793746845&p=event_visibility&hl=en&rd=1

JonDBl commented 1 month ago

I have the same issue and it does seems to come from a 3rd party creating flight or Booking.com events in my google calendar

the solution I have found is to open the event in google calendar and mark it as Default visibility https://support.google.com/calendar/answer/34580?visit_id=638579552194347502-3793746845&p=event_visibility&hl=en&rd=1

Thanks for that.

It seems to be an issue with latest version?

paulwinton commented 1 month ago

Good morning, thanks for you comments. Is it possible to find which event is causing that problem from the log?

ybroudo commented 1 month ago

sometimes you will see the text of the event in the log but not always, didn't figure out when it does and when it does not

phw198 commented 1 month ago

I suspect this is affected people trying to two-way sync their default Google calendar, which is includes events auto generated from Gmail. This won't be a new problem, but would be good to make OGCS handle the failure better.

I can look to get out a hotfix version to log extra details about the problematic events, or if someone wants to go through the below, that would speed things up:

  1. Go to https://calendar.google.com/calendar/u/0/r/week?eventdeb=1
  2. Find one of the auto-generated events
  3. Click the event, then the 3-dot elipses menu, click "Troubleshooting Info" at the bottom
  4. Make a note of the organizer and eid values
  5. Go to https://developers.google.com/calendar/api/v3/reference/events/get
  6. Click API on the right and then "Try It" - authorise API explorer to access your calendar
  7. Plug in values from step 4: calendarId = organizer; eventId = eid
  8. Click execute
  9. Copy and paste the JSON output here.
phw198 commented 1 month ago

Ah no, I've found the cause - Google started categorising these types of events differently from 30-May-2024: they now have an eventType of fromGmail instead of default.

I'll look to get a fix out to exclude such events from sync, though if anyone wants to confirm this is the issue by following the steps in my previous post, feel free 🙂

Also, if anyone can increase their logging level to FINE, reproduce this issue and then provide the logfile (or just the lines preceeding the error) - I'd be interested to know what properties OGCS is trying to update in Google that aren't being allowed.

JonDBl commented 1 month ago

Hi Paul,

I get a 404 error in the API because the Organizer ID is invalid when I troubleshoot.

Event{eid=_6tlnaqrle5p6cpb4dhmj4phpehp36q1g6hl7at1j75h6qc1k6pn36p3h6pm36c34cllmut35copn4r3mdtmn4rbdd1m6gd1me4sjgr9m68pme, @., @., @.***,

If I include the correct calendar ID it still gives a 404 error.

All the affected events have the same issue.

Regards, Jon.

JonDBl commented 1 month ago

Thanks for the update,

I have sent the info which failed when I followed you instructions.

Basically your workaround will not include these entries in outlook?

Regards, Jon.

phw198 commented 1 month ago

Hi @JonDBl - could you log in to GitHub to update your posts? The emails are heavily redacted...

The blog I linked to says 'Include the email recipient as the organizer instead of “unknownorganizer@calendar.google.com”.' - are you not seeing your own email address (gmail account) as the organiser?

Basically your workaround will not include these entries in outlook?

I'm not entirely sure yet. I'll probably add an option to exclude Gmail events. But if included, for two-way sync I could maybe restrict the attributes that OGCS is trying to update in Google. The permitted list is reminders, colorId, visibility, status, and extendedProperties - so it would be helpful to know which other attributes OGCS is trying to update.

JonDBl commented 1 month ago

Hi Paul,

This is a typical event with the issue (troubleshooting info):

Event{eid=_6tlnaqrle5p6cpb4dhmj4phpehlmmq1jcdr6uqrac4p6mp9gcdl3aobcdlmmudj2ctn6is1m70r6errlc9k32rjce4q6qqbc6tp6orb575r30, organizer=unknownorganizer@calendar.google.com, participant=jonbloom.jb@gmail.com, actor=jonbloom.jb@gmail.com, summary=Flight to Knock (EI 915), status=CONFIRMED, seq=0, startTime=2024-09-04T10:05:00Z, endTime=2024-09-04T11:35:00Z}

I have changed the organizer, here is the output:

{
 "kind": "calendar#event",
 "etag": "\"3437139111949000\"",
 "id": "_6tlnaqrle5p6cpb4dhmj4phpehlmmq1jcdr6uqrac4p6mp9gcdl3aobcdlmmudj2ctn6is1m70r6errlc9k32rjce4q6qqbc6tp6orb575r30",
 "status": "confirmed",
 "htmlLink": "https://www.google.com/calendar/event?eid=XzZ0bG5hcXJsZTVwNmNwYjRkaG1qNHBocGVobG1tcTFqY2RyNnVxcmFjNHA2bXA5Z2NkbDNhb2JjZGxtbXVkajJjdG42aXMxbTcwcjZlcnJsYzlrMzJyamNlNHE2cXFiYzZ0cDZvcmI1NzVyMzAgam9uYmxvb20uamJAbQ",
 "created": "2024-03-29T17:09:29.000Z",
 "updated": "2024-07-30T17:48:21.921Z",
 "summary": "Flight to Knock (EI 915)",
 "description": "To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar\n\nThis event was created from an email that you received in Gmail. https://mail.google.com/mail?extsrc=cal&plid=ACUX6DMAAZix-1NtwNThzCtXeclW6MJztQx1pLA\n",
 "location": "London LHR",
 "creator": {
  "email": "jonbloom.jb@gmail.com",
  "self": true
 },
 "organizer": {
  "email": "jonbloom.jb@gmail.com",
  "self": true
 },
 "start": {
  "dateTime": "2024-09-04T11:05:00+01:00",
  "timeZone": "Europe/London"
 },
 "end": {
  "dateTime": "2024-09-04T12:35:00+01:00",
  "timeZone": "Europe/London"
 },
 "transparency": "transparent",
 "iCalUID": "7kukuqrfedlm2f9tkkh3cvokja2ke0cj5almmo6bgnip686goubh1nlq4mil7rlme9v0",
 "sequence": 0,
 "attendees": [
  {
   "email": "jonbloom.jb@gmail.com",
   "organizer": true,
   "self": true,
   "responseStatus": "accepted"
  }
 ],
 "extendedProperties": {
  "private": {
   "outlook_GlobalApptID": "040000008200E00074C5B7101A82E00800000000A087D47DB69DDA0100000000000000001000000020AC7718B5EAED48AC8874B0B16549E2",
   "OGCSmodified": "20240504000328",
   "outlook_EntryID": "00000000A752EC803A1A064199D2E3126AF6CD2744FE2700",
   "outlook_CalendarID": "00000000A752EC803A1A064199D2E3126AF6CD27A2800000"
  }
 },
 "guestsCanInviteOthers": false,
 "reminders": {
  "useDefault": false
 },
 "source": {
  "url": "https://mail.google.com/mail?extsrc=cal&plid=ACUX6DMAAZix-1NtwNThzCtXeclW6MJztQx1pLA",
  "title": ""
 },
 "eventType": "fromGmail"
}
phw198 commented 1 month ago

Turns out that OGCS already excludes these fromGmail events since v2.10.5.

So do people actually want to sync these items?

isteo77 commented 1 month ago

Turns out that OGCS already excludes these fromGmail events since v2.10.5.

So do people actually want to sync these items?

Hi Paul !

Thanks for your hard work.

I tried to follow and understand you explanations, but it was a bit to hard for me.

I understand that auto generated events created by google (gmail or other) do not sync properly anymore.

I must say that I would be happy if this pb could be fixed.

I have a lot of auto generated event on my google calendar with this info : organizer=unknownorganizer@calendar.google.com Some of them are old. Some are far ahead in the future.

Could you share an easy way of fixing this pb ?

Thanks in advance

Florent

phw198 commented 1 month ago

Sure - the "fix" is to upgrade to latest release by going to the About tab in OGCS, ticking the Check for Alpha releases box and then clicking Check for Update.

Alternatively, download the latest version directly from the project website.

This will exclude automatically generated events from sync. My previous question has been to whether people actually want to sync these items....

isteo77 commented 1 month ago

Just perfect !!

Works fine !

Thanks a lot. Youre not-so little software is wonderful to use.

Florent

paulwinton commented 1 month ago

Thanks all, works well now with update to latest version