derekantrican / GAS-ICS-Sync

A Google Apps Script for syncing ICS/ICAL files faster than the current Google Calendar speed
GNU General Public License v3.0
1.5k stars 191 forks source link

Error sync'ing iCloud Calendar #351

Closed guice closed 6 months ago

guice commented 1 year ago

The problem

When trying to sync my iCloud calendar, I'm getting the following error:

ParserError: Missing parameter value in 'X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS={addr ln 1}\\n {city} {state} {zipcode}\\nUnited States;X-APPLE-ABUID="{sensored}’s Home"::;X-APPLE-MAPKIT-HANDLE={removed key};X-APPLE-RADIUS={radius};X-APPLE-REFERENCEFRAME=1;X-TITLE={title name addr line 1}'

Screenshot 2023-07-20 at 1 18 34 PM

I looked through my events and I couldn't find one titled with "{title name addr line 1}" (the address). So, I honestly have no idea where it's getting that title. I've attempted to use var onlyFutureEvents = true; with the same error -- and I know I have no future events at my friend's place.

Is there anyway to just log and skip events the code is having trouble sync'ing? This would certainly get it working and allow people to look back to the ones that errored sent, say via the email option?

Version of GAS-ICS-Sync

5.7

Additional information & file uploads

All settings are currently default. I was able to get one calendar sync'd just fine. It's only my Apple iCal calendar that's failing.

I tried creating a sanitized calendar for you, but it appears to be stuck on "waiting" for over 5 minutes. Maybe it errored out on this same issue?

guice commented 1 year ago

I have discovered the root cause: poor location entries. I commented out the exception line, which then resulted in log warnings of bad lines being parsed. This allowed me to track down the individual events causing these errors -- I had 7 of them. I deleted them from my calendar and now it works!

With that said, is this exception throw really necessary? I commented this out to allow me to finally track down the rouge events: https://github.com/derekantrican/GAS-ICS-Sync/blob/e5cd8e02417ee38a04eadbd795201822dbac2e2d/ical.js.gs#L1894

llllogan commented 1 year ago

This fix also worked for me. My iCloud calendar was throwing the same error and I was able to track down the culprits with this Exception commented out.