Server Errors in Google Apps Script - google-apps-script

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.

Related

Random Exception - "Service timed out: Spreadsheets" in Google Apps Script

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.

Google Apps Script error - Service unavailable: Gmail

My Google Apps Script time-based Trigger is failing with error:
Service unavailable: Gmail (line XXX, file "XXXXXXXXXXXX")
The code gets emails from a Google Sheet and send emails to them.
My spreadsheet has more than 8k+ records.
Initially I suspected error due to data loading, but later I realized that it is not due to load as my friend is able to run the script smoothly without any error from her gmail account.
I have checked my gmail storage limit and freed up.
Cleared browser history and cookies.
Please help this issue resolved and let us know some precautions or steps to prevent this happening in future.

Your script, Drive Migrator, has recently failed to finish successfully

I have this email from google.
Your script, Drive Migrator, 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.
There are about 200 messages of the format:
Start 1/1/19 4:53 PM
Function processFilesAndFolders
Error Message Authorization is required to perform that action.
Trigger time-based
End 1/1/19 4:53 PM
When i click there i fund there is an empty trigger and no further information.
Project -
Last run -
Deployment -
Event Time-based
Function -
Error rate -
Its very strange given nobody was on the system at this time, and I cannot see any details about the trigger.
How do I see what is happening here? Is someone on my system, trying to move my files around? How is is possible to have a trigger that is void of information like this? It looks somewhat hacky. Can I centrally disable this "drive migrator"?
I found an old question about this: Drive Migrator Fail Message
But, perhaps it does not have enough information to get a proper answer.
I also contacted google support directly, but they said that asking here is the only way to get technical support on this service. I understand this is not the best "stackoverflow type question", but I'm at a loss on where to get further information about this.
The failure notifications likely occur when a Google Script is deleted from your Drive without de-authorization or when the permissions get revoked for some reason.
Go here and you'll find a list of all triggers running under your Google account. Delete the one associated with your Failure emails.
This guide explains how you can unsubscribe from the failure emails and also properly de-authorize the associated script.

google drive apps script > "Service unavailable: Docs"?

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.

MailFred Issue Emails

I recently changed the security in my Google settings and I keep getting an email that starts with the following sentence:
"Your script, MailFred 1.145, 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 there all I get is a 404 Forbidden page. Back in the email text there is a long list of when the script has failed. I am not sure how to fix this issue, but I would like to stop getting the emails.
Any help would be much appreciated!
Go to your Google Accounts Settings and under Security, click the Apps and Websites link.
Here you'll see a list of all scripts that have access to your Google Account. Revoke access to the one that is sending those error notifications.
You're right in your comment : revoking authorization while letting the script run is the origin of the error and the subsequent errors notifications...
I don't know the MailFred app but from what I saw on their site it's all built using Google-Apps-Script so I guess the trigger they use must appear as any other one...
To disable this triggers that is trying to run , follow these simple steps :
open any Google Spreadsheet, document or form
then open the script editor (from the "tools" menu),
go to 'resources' > triggers > all your triggers
and there delete the trigger(s) that you don't want to run.
If you see many of them, try to determine which one belongs to this app... you can check the notification mode, set it to a known time and wait for the next email, see at what time it was sent... The method is not very acurate (about an hour time frame) but it can help.
Sorry I can't be more concise, I don't use this app and didn't find a lot of informations about it.
Here is the example of how I did it. It's a pretty straight forward according to me.
See the following message I got when my script fails. It says,
"Your script, clearContent, 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."
You should be getting the same kind of message. Click on "click here" hyper linked text, it will directly take you to the settings page of that trigger. And, just change the setting of the particular trigger or delete it.