On my paid Google account, I have a lot of sheets using various scripts to fetch urls. I know there is a daily quote of fetches set, but the issue I have is that even if I don't open any of my sheets with scripts for over 24 hours, and then I open one, I get the over quota error message: Service invoked too many times for one day: urlfetch. I wouldn't have thought scripts would be running in the background, ie. without me opening them, but I can't explain this in any other way - does anyone know if this is so? Another way to put the question, how can I avoid getting such error?
Do you have any time based triggers set up for other scripts?
You can check by going to script.google.com and selecting My Triggers on the left hand side. Some of you scripts may be set to run even if you are not present.
Related
Context: I have a Google Spreadsheet with some data imported from the external API + some calculations done. API access + calculations are done using Google Apps Script. All those functions are within two files that belong to one project. Today in the morning I noticed multiple
Exception: Service invoked too many times for one day: urlfetch. errors. Strange enough, as neither I nor the second collaborator was working overnight. When I checked executions, it turned out there were multiple executions over the night. It looked as if the document was refreshed every 20-30 minutes.
Questions
How can I check what triggered those functions?
Any ideas how to prevent those executions?
I am trying to build a Google Data Studio Connector, but I am facing a Google Apps Script timeout issue for UrlFetchApp.fetch(). Is there any way we can extend it or fix it, because it is breaking our reports.
It happens due to multiple calls to our API simultaneously.
is your script running for more than the typical 30 minutes allowed? I had a UrlFetch situation where the order of arguments impacted how long it took to run the script. And by modifying the order, we got our script to run in 2-3 minutes instead of timing out.
I have several scripts bound to a spreadsheet that create 14 folders containing a total of about 240 google sheets. The original sheet that the scripts are bound to contains about 34000 rows of data that are divided among the newly created sheets. While I was working on it I frequently deleted and recreated all the folders and sheets and it worked fine. Yesterday, as I'm ready to do my final run and create the spreadsheets that will be shared and used I started getting "We're sorry, a server error occurred. Please wait a bit and try again". I tried again this morning and got the same thing.
I have tried a different browser. I created a new sheet and copied the scripts over. Then I deleted all but a single script that creates the folders and commented out all of the code in that except 3 lines that get the current spreadsheet and write out a message but I'm still getting the error.
The link to my stripped down, barely there but still not working spreadsheet is https://docs.google.com/spreadsheets/d/18_FjSpuGONEVzNZu5Ta8hm0YopsdlZlPRRAV7cx5VTE/edit#gid=1999362590
I'm thinking it may have something to do with my user account, or having reached some quotas. Is there any way to check that?
If you reach a quota when using a Google App Script, it should notify you with a specific exception. The quotas themselves can be seen here.
Have you tried removing the permissions for the script and authorising it again? I have had this issue previously and this resolved my problem (although, I accept it will not always resolve this problem...).
I would post the link, but I don't have enough reputation to post more than 2 links... Google "See apps connected to my Google account".
This question already has answers here:
Summary of failures for Google Apps Script: Not found
(2 answers)
Closed 5 years ago.
I am getting below email on daily basis. How to stop it??
Summary of failures for Google Apps Script: Eml Manager
If you are not supposed to be running any scripts then you can just open the script editor, click on Resources → All Your triggers and then remove triggers you do not want. You can also simply disable notifications by clicking on the Notifications link to the right of the trigger and removing your e-mail.
Otherwise, in a similar manner, go to the Eml Manager and fix the code :)
If you are getting 'Summary of failures for Google Apps Script' on daily basis, you should look forward to fixing your code because code isn't behaving as you had expected.
Here are few of the reasons which can cause those failure emails:
Too many simultaneous invocations on the google app to which you have attached your appscript
Authorization or Authentication issue (a new user of the script has to authorize it first time)
Script took more than 6 minutes to complete (6 min is the limit)
If you have created programatical triggers, and forget to delete them once it has served the purpose, it will keep on creating new triggers and there is total trigger limit per script is 20.
In some cases, server can also be too busy to trigger your script but that rarely happens.
Also, if your script is taking too longer to complete, you should look forward to reducing the looping and also reducing writing operations on google apps(as it keeps on saving every change you made). Also, use in built formulas etc as much as possible.
If your code is totally fine according to you, then you can stop those failure emails by removing your name from the notifications option of your triggers as #Vytautas mentioned.
I have shared a Google Script with Public. However, the users keep getting an error message saying that too many people are accessing the file.
How do I fix this?
Unfortunately the current architecture of the script editor makes it so only a limited number of users can access a given script at the same time. We are working on some long term fixes for this limitation, and you can follow the progress on Issue 2167. In the mean time, we recommend you use another method to share your script source with a large number of people.