I have a Google Apps Script that works fine for most (>95%) of the time.
The script is bound to a Google Form and is set to be run on the 'On
Form Submit' event.
The script has a try-catch block.
This block catches an exception once in a while - Service timed out:
Spreadsheets.
There is no pattern to when this occurs. It is random.
Just to clarify. The script DOES NOT time out and IT DOES finish running as expected.
But, on random occasions, the script does not do it's job because of the "Service timed out: Spreadsheets" exception that is thrown when the script tries to write to a Google Spreadsheet.
Is there any way I can figure out what's the root cause of this? And is there anyway I can get some support for this issue?
I tried contacting Google Workspace support and they directed me here to SO to see if I can get some help.
You are most likely hitting one of the limitations of Apps Script. Perhaps you should time the function and try to optimize your code.
Related
I have a Google Sheets document that has a script attached to it and this AppScript includes a function that runs on a trigger every hour. The script fills in the sheet with importrange-formulas to get data from other sheets. It's been running fine for 6 months, but today I got an error.
The scheduled script has stopped running. When I try to manually run the function I get authorization request, and when I try to grant the script permission to run I get "Error 401: disabled_client".
I have similar scripts running in other Google Sheets document on similar trigger settings, and those keep running just fine. All the scripts are running on the same enterprise account.
Any ideas what can be going on here?
Grateful for any help to solve this.
I'm creating a Gmail Addon and for some reason AppScript has stopped updating when I save my code. Up until last week I would make changes, save my code, refresh Gmail add the updates would be there. The addon is installed as a developer addon using the HEAD version.
First question, do I have to re-deploy or anything after making changes? As far as I can see in the documentation the approach above should work fine.
I'm using the Google Oauth2 library to login into an external service. It was all working fine last week and now I've just noticed these errors come up in the execution hints...
Method Properties.deleteProperty invoked in the global scope.
File: Storage
Line: 125
This function invocation will fail when the script is run as an Add-on in AuthMode.NONE.
Method Cache.remove invoked in the global scope.
File: Storage
Line: 127
This function invocation will fail when the script is run as an Add-on in AuthMode.NONE.
Method ScriptApp.getScriptId invoked in the global scope.
File: Service
Line: 36
This function invocation will fail when the script is run as an Add-on in AuthMode.NONE.
I don't have access to the files that the errors are referring too though so how am I supposed to fix them?
Also if there are errors in the execution hints will that prevent any updates to the code? Is that the reason I wouldn't be seeing my updates come through?
I know the updates aren't working because I'm seeing nothing in the logs where I was before.
Really appreciate any help. I've spent hours going through the docs, SO and the issue tracker trying to figure this out.
I have a script that takes a Google spreadsheet writes the text to a Google Doc. When I try to run the function, I get the message in red at the top of the page Service unavailable: Docs (Dismiss). This is new. What does this error mean? Thanks!
In addition to #Pierre-Marie Richard's answer, the error Service unavailable: Docs usually happens when you are using an invalid Doc ID.
This happens to me when appending a paragraph element to a document, if the paragraph element contains an image. I think it's related to either of the following bugs:
https://issuetracker.google.com/issues/142533361
https://issuetracker.google.com/issues/117212337
As mentioned in the documentation :
Server not available.
Server error occurred, please try again.
There are a couple possible causes for this error:
A Google server or system is temporarily unavailable. Wait for a few moments and try running the script again.
There is an error in your script that doesn't have a corresponding error message. Try debugging your script and see if you can isolate the problem.
There is a bug in Google Apps Script that is causing this error. Report the error on the issue tracker.
I have some exisiting google app scripts in a spreadsheet of my google drive.
Tried to create a time driven trigger under Script Editor -> Resources to automate the execution of a script. Encountered error: 414. That’s an error.
The requested URL /... is too large to process. That’s all we know.
Read through some of the existing similar issues/solution. Nothing specific to time driven triggers found.
Anyone has a workaround ?
Have you tried running the script without the trigger? I find most times I get that error it's because I'm trying to add a trigger to a script that I haven't yet run and authorised first. Good luck!
Every morning I get an email from Apps Script saying this:
Summary of failures for Google Apps Script: Not found
Your script, Not found, has recently failed to finish successfully. A
summary of the failure(s) is shown below. To configure the triggers
for this script, or change your setting for receiving future failure
notifications, click here.
When I click the link in the email, it tries fetching the triggers but returns another error:
We're sorry, a server error occurred. Please wait a bit and try
again.Dismiss
How do I get rid of these messages?
There is a topic about this problem on the GAS issue tracker. Please star it to promote it to the support.
How do I get rid of these messages?
Now a solution is to filter such messages in your email system or to wait when the GAS teams fixes it.