Skip to content
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

TypeError: Cannot read property 'dateTime' of undefined (line 493, file "Helpers") #135

Closed
deanosauras opened this issue Jun 15, 2020 · 27 comments · Fixed by #151
Closed
Labels
bug Something isn't working

Comments

@deanosauras
Copy link

deanosauras commented Jun 15, 2020

  • Description of the problem
    Outlook to Google calendar using ics link is showing attached error. However, it seems to be working as far as syncing most of the events in the calendar. I don't know if it is just warning or a genuine error that doesn't sync all the events in my calendar. I am using 5.2 script.

Is it possible that this is caused by a recurring calendar event on Outlook. And one for the event dates in the series has a different time?

Not a duplicate of #133 #115

  • Screenshots
    2020-06-15 14_04_01-Outlook to Google Calendar Sync

image

You can see this issue for an example of good information when submitting a bug

@deanosauras deanosauras added the bug Something isn't working label Jun 15, 2020
@jonas0b1011001
Copy link
Collaborator

I don't get an error with 5.3, try updating to the latest version.

@deanosauras
Copy link
Author

I don't get an error with 5.3, try updating to the latest version.

How do I check which version I am running Jonas? I copied the scripts from readme section mentioned at this URL https://github.com/derekantrican/GAS-ICS-Sync.

@jonas0b1011001
Copy link
Collaborator

Open the copy of your script, at the bottom of Helpers.gs you can find a thisVersion variable.

Did this error occur at the first run it did it start to appear after the script ran several times?

@derekantrican
Copy link
Owner

Check near the bottom of Helpers.gs. You should see a thisVersion = 5.2. Don't worry if you don't have the latest version: version 5.3 was only released recently so it may have been after you got yours (and we don't have the best "update alerts" yet)

@deanosauras
Copy link
Author

Confirmed 5.3 and still occuring.
image

This error occurs every run manual and automatic trigger. I have updated the screenshots on the original post. Containing log from My executions page. If that helps investigate better.

@deanosauras
Copy link
Author

deanosauras commented Jun 15, 2020

Here is my suspect: @jonas0b1011001 @derekantrican

This error might be occurring when a recurring event chain is broken.
I have bug grooming every Mon, Wed and Friday
image

But in the week of 8/6/2020 I moved my Monday bug grooming to Tuesday. Just since event was in the series was moved. And the script might be complaining about that broken chain as per the date in the log.
image

image

Don't know if that helps much.

@jonas0b1011001
Copy link
Collaborator

jonas0b1011001 commented Jun 15, 2020

How does that week look in your google calendar?

Edit:
Never mind, i think the problem is an old version of ical.js.
I just updated to the latest version last week on my dev branch, just replace your ical.js.gs with this and try to sync again.

@deanosauras
Copy link
Author

Thank you @jonas0b1011001 I have done a couple things:

  • To continue to investigate the pattern. I deleted the script created calendar from google.
  • I decided to only sync future events. That seems to be successful. There is still a tiny problem but it is not major annoyance.
  • I have copied over your ical.js file as well.

That tiny problem is related to breaking a recurring series but it not failing the sync any more so that is good news. I'll log it as an enhancement request but nothing major.

@BoredMind
Copy link

I am still seeing this issue. I've replaced the ical.js.gs with the one in your dev branch and it's still happening. Any suggestions?

Jul 27, 2020, 11:30:42 AM Info Processing 2 Recurrence Instances!
Jul 27, 2020, 11:30:42 AM Info 2020-07-30
Jul 27, 2020, 11:30:42 AM Error TypeError: Cannot read property 'dateTime' of undefined
at unknown function
at processEventInstance(Helpers:492:45)
at startSync(Code:203:7)

@jonas0b1011001
Copy link
Collaborator

@BoredMind Are you trying to sync an Outlook calendar?

@cinzas
Copy link

cinzas commented Jul 29, 2020

I'm having the same issue.

Syncing from a outlook 365 account .

@dannycohn
Copy link

Originally, replacing ical.js resolved my problem, but I just started seeing this error again. I will try to get more details to help debug

@jonas0b1011001
Copy link
Collaborator

Can one of you share the ics that is producing the error?
You can use Derek's tool to remove personal data (Event IDs should remain unchanged).

@dannycohn
Copy link

I could be wrong, but it appears to be having an error when interrogating the Google Calendar event, not the ICS event. The error occurs on line 493, when it's iterating over the Google calendar events that were brought back to match the ICS event.

Below is the item that is missing the originalStartTime object

{
   "iCalUID":"REDACTED",
   "status":"confirmed",
   "summary":"Private Appointment",
   "updated":"2020-07-27T13:11:22.748Z",
   "id":"REDACTED",
   "htmlLink":"REDACTED",
   "reminders":{
      "useDefault":true
   },
   "sequence":0,
   "etag":"\"3191710965496000\"",
   "end":{
      "timeZone":"America/Chicago",
      "dateTime":"2020-07-20T18:00:00Z"
   },
   "created":"2020-07-27T13:11:22.000Z",
   "visibility":"private",
   "kind":"calendar#event",
   "start":{
      "timeZone":"America/Chicago",
      "dateTime":"2020-07-20T16:00:00Z"
   },
   "organizer":{
      "displayName":"Danny's Work Calendar",
      "self":true,
      "email":"REDACTED"
   },
   "creator":{
      "email":"REDACTED"
   },
   "extendedProperties":{
      "private":{
         "fromGAS":"true",
         "rec-id":"040000008200E00074C5B7101A82E008000000007BA48968CC5AD601000000000000000010000000A0C03B732B298141A5815BBB2AF2462A_2020-07-20T05:00:00Z",
         "id":"040000008200E00074C5B7101A82E008000000007BA48968CC5AD601000000000000000010000000A0C03B732B298141A5815BBB2AF2462A",
         "MD5":"-30,-15,-17,66,-123,103,105,41,109,-119,-56,-94,54,26,51,-125"
      }
   }
}

@dannycohn
Copy link

Could it be that I have corrupted events in my Google calendar from before I updated ical.js? I can clear my calendar of all synced events and start over.....

@jonas0b1011001
Copy link
Collaborator

I can clear my calendar of all synced events and start over.....

That should not be necessary.
Can you do a search for 040000008200E00074C5B7101A82E008000000007BA48968CC5AD601000000000000000010000000A0C03B732B298141A5815BBB2AF2462A in your source ics and share the events that come up?

@dannycohn
Copy link

Well, before I heard back, I deleted the recurring event from my O365 calendar, synced, and re-added it and resynced. No errors now. If it crops up again, I'll come back and share more details

@BoredMind
Copy link

BoredMind commented Jul 29, 2020

@BoredMind Are you trying to sync an Outlook calendar?

I am syncing from an Outlook calendar. I've exported my ical and scrambled all but the Event IDs:
redacted

@jonas0b1011001
Copy link
Collaborator

I can't find an obvious reason why it's not working with the fix from above.

Can you sync the ics to a fresh google calendar using this version of the script and share the log file (You will find it here by selecting the corresponding entry).

@BoredMind
Copy link

I can't find an obvious reason why it's not working with the fix from above.

Can you sync the ics to a fresh google calendar using this version of the script and share the log file (You will find it here by selecting the corresponding entry).

That seemed to fix it. Ran twice without issue. Thank you very much.

@jonas0b1011001
Copy link
Collaborator

Can you please check the log of the first run for errors (especially towards the end after "Processing X Recurrence Instances!"), just to be sure it is now working as intended.

@BoredMind
Copy link

Jul 30, 2020, 10:33:44 AM Info Done processing events
Jul 30, 2020, 10:33:44 AM Info Checking 27 events for removal
Jul 30, 2020, 10:33:44 AM Info Done checking events for removal
Jul 30, 2020, 10:33:44 AM Info Processing 0 Recurrence Instances!
Jul 30, 2020, 10:33:44 AM Info Sync finished!

I do know I have a bunch of recurring events, but those appear to be sync'd.

@jonas0b1011001
Copy link
Collaborator

The recurring event series is synced separately, at this point the script is processing exceptions to a given series (i.e. an event is taking place every monday but on a specific date it is moved to tuesday), the file you shared earlier had quite a lot of those.

@BoredMind
Copy link

Yes, that happens frequently in my calendar. So far the dev version appears to be working, I haven't noticed any issues but I'll keep an eye on it unless you need any more data.

@melvanderwal
Copy link

melvanderwal commented Aug 4, 2020

Just a confirmation of the solution... was having the same problem: an instance of an O365 recurring meeting had been rescheduled, which raised the error in Helpers.gs and the script refused to update that instance of meeting to its new time in the Google Calendar. Switched to the dev version of the script project and pointed it at the same Google Calendar (i.e. didn't create a new Google Calendar). No errors, and the script updated the rescheduled meeting time in the Google Calendar. Happy days.

@hgabreu
Copy link

hgabreu commented Aug 20, 2020

Yet another confirmation here. Had the same issue on Helpers.gs:493 on version 5.3 and updated the code to version linked on this comment and it is now working fine. I didn't re-create or changed anything on my gcal or O365.

Why not update this version on the repo?

@vasekbrychta
Copy link

I can confirm that copying the content of ical.js.gs from dev branch solved this issue for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants