hk21702 / YA-GCal-Notion-Sync-Script

Script to synchronize between a Notion database and Google Calendar both ways. Uses Google App Script.
GNU General Public License v3.0
142 stars 11 forks source link

"Service invoked too many times" Error Message #18

Closed prossberg closed 2 years ago

prossberg commented 2 years ago

I have one of the triggers set up to be every 15 minutes. This worked fine up until yesterday when I swapped the code I used for a newer version. The it started failing and throwing errors. First this longer error:

Error: Error trying to get page property Last Sync from page bcfa4608-1c6c-42df-bc74-eff395bfb0a6. Ensure that the database is setup correctly! EM: Service invoked too many times for one day: urlfetch.
    at getPageProperty(main:386:11)
    at isPageUpdatedRecently(main:753:24)
    at syncToGCal(main:60:9)
    at main(main:27:23)

The after a few failed attempts it just went down to this:

Exception: Service invoked too many times for one day: urlfetch.
    at notionFetch(main:408:32)
    at syncToGCal(main:53:25)
    at main(main:27:23)

immediately after starting the sync to GCal.

Is this a problem with Notion receiving to many requests or something else?

hk21702 commented 2 years ago

It is an issue with one of the API's used to interact with Notion's API being rate limited. I released an update that, along with some bug fixes, should hopefully reduce the chance of this happening.

prossberg commented 2 years ago

Got it. The best way to update is just copy the new contents of the file over the old and redo changes to variable names right?

hk21702 commented 2 years ago

Yup. Make sure to double check if anything changed in the structure of the database but for this update there shouldn't be any changes.

prossberg commented 2 years ago

Worked without errors. This integration is awesome and so is your support.

emirusahin commented 1 year ago

Hey! I implemented this integration a few days ago (with the latest code updated), but I still get the mentioned error. 5:44:38 PM Error
Exception: Service invoked too many times for one day: urlfetch. notionFetch @ Code.gs:480 syncToGCal @ Code.gs:75 main @ Code.gs:31

Any recommendations for me?

hk21702 commented 1 year ago

Hey! I implemented this integration a few days ago (with the latest code updated), but I still get the mentioned error. 5:44:38 PM Error
Exception: Service invoked too many times for one day: urlfetch. notionFetch @ Code.gs:480 syncToGCal @ Code.gs:75 main @ Code.gs:31

Any recommendations for me?

You're being rate limited. Reduce the frequency for which you are auto triggering the script. It might also resolve itself in a day anyways because the initial setup and sync will require a lot of API calls. However, since you said that you are getting the error even after a few days, you are likely just calling the script too often.