Help for owners
My Google Apps Script automation stopped working
Short answer
Google lists the usual causes: the script needs authorization again, a daily quota was used up, or a trigger failed. Installable triggers run as the person who created them, so a departed owner breaks them. Open the Executions log in the Apps Script project to see the exact error.
Does this sound like your situation?
- A sheet or form that used to update itself no longer does.
- I get an email from Apps Script about a failed trigger.
- The error says authorization is required, or the service was invoked too many times.
- It stopped after someone left the company or changed their account.
- It works when I run it by hand but not on its own.
Why does this happen?
Authorization is needed again
Google lists the error Authorization is required to perform that action as a common cause. It appears when a trigger fires before authorization or after it has expired, and is cleared by opening the script editor and running a function to re-authorise.
Confirmed by developers.google.com
A daily quota ran out
Google lists the error Service invoked too many times as meaning the daily quota for an action, such as sending email, is used. Google's quota table gives consumer accounts 90 minutes of trigger runtime per day and Workspace accounts 6 hours, a script run limit of 6 minutes, and 100 or 1,500 external email recipients a day respectively.
Confirmed by developers.google.com
The trigger runs as its creator
Google states that installable triggers always run under the account of the person who created them, and that emails they send come from that account. If that person's account is closed, changed or loses access, the trigger fails.
Confirmed by developers.google.com
A trigger failed and notices went unseen
Google states that when an installable trigger fails, Apps Script emails a summary to its owner with links to reconfigure or deactivate it. If that mailbox is unwatched, a failure can go unnoticed for weeks.
Confirmed by developers.google.com
The data or the sheet changed
Someone renamed a tab, moved a column, deleted a row or changed a folder, and the script no longer finds what it expects.
What can I do about it today?
- Open the project and read the Executions listGoogle states that Apps Script records every execution. Find the most recent failure and copy its message.
- Find out who owns the triggerLook at the Triggers panel and ask that person whether they still have an active account.
- Re-authorise only if you know the scriptIf the error asks for authorization and the script is yours, open it and run any function, then accept the permissions you recognise. Do not accept permissions for a script you do not know.
- Do not delete triggers or the scriptKeep everything as it is until someone has copied it. A deleted trigger is easy to lose and hard to remember.
- Copy the script and the sheetMake a copy of the file before anyone edits it.
When should I bring someone in?
- Nobody knows what the script does or who wrote it.
- The script does business tasks such as invoices, orders or customer emails.
- It keeps hitting quotas or the six-minute limit as your data grows.
How do I handle it?
- Read the execution logI start from the Executions list and the message, then read the script to see what it expects from the sheet.
- Find the owner and every triggerI list every trigger, which account owns it and what each one calls, so the script no longer hangs on one person.
- Fix on a copyI repair a copy of the file and test it with sample data before it touches the live sheet.
- Split long jobsWork that takes close to the runtime limit is split into smaller steps that continue where they stopped.
- Write a short noteYou get a plain note of what the script does, who owns it and where to look when it fails.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Why does it work when I run it by hand?
A manual run uses your current permissions. A trigger uses the account that created it and the authorization stored for it, which may have expired.
Can a script keep running if its owner leaves?
Only if the trigger is recreated under an account that stays. Google states that installable triggers run under the account of the person who created them.
Is there a limit on how long a script may run?
Google lists a script runtime of 6 minutes per execution and a daily trigger runtime that differs between consumer and Workspace accounts.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.