akarri2001 / Notion-and-Google-Calendar-2-Way-Sync

2 Way Sync Between Notion Database and Google Calendar
GNU General Public License v3.0
352 stars 50 forks source link

notion_gCal_IDs.append: List index out of range #9

Open ResanChea opened 3 years ago

ResanChea commented 3 years ago

I just set up your script and can't figure out what's wrong from this error. May you help?

❯ python3 ./Notion-GCal-2WaySync-Public.py 

Nothing new added to GCal
Nothing new updated to GCal
Traceback (most recent call last):
  File "/home/blue/Downloads/Notion-and-Google-Calendar-2-Way-Sync/./Notion-GCal-2WaySync-Public.py", line 841, in <module>
    notion_gCal_IDs.append(result['properties'][GCalEventId_Notion_Name]['rich_text'][0]['text'])
IndexError: list index out of range
akarri2001 commented 3 years ago

Can you try changing it to result['properties'][GCalEventId_Notion_Name]['rich_text'][0]['text']['content'] throughout the script instead and seeing if it works?

Xx-KaixX commented 3 years ago

I'm also having the exact same issue but it's at line 877 for me

akarri2001 commented 3 years ago

For the line 877 error @Xx-KaixX, do you have anything on the Notion database? If not, add something that you want on your calendar, and then try it out

Xx-KaixX commented 3 years ago

Yeah, I'm trying to sync an event from Notion to Google Calendar and then this error is coming up

austinvdubs commented 3 years ago

@akarri2001 I'm also getting this error on line 456:

...\Notion-To-gCal-Sync\Notion-GCal-2WaySync-Public.py", line 456, in <module>
    TaskNames.append(el['properties'][Task_Notion_Name]['title'][0]['text']['content'])
IndexError: list index out of range

Any idea how to address this?


Edit: I figured it out. The issue was because I had several tasks with blank Names in Notion.