Started getting "authorization is required to perform that action" out of the blue.

202 views
Skip to first unread message

Jungle

unread,
Apr 28, 2023, 6:36:38 PM4/28/23
to Google Apps Script Community
Hi all,

Some weeks ago I started getting daily emails saying that some executions failed because "authorization is required to perform that action". The code has been working for years without issues, it hasn't changed, and it's called from a few triggers that run between once an hour to once a day, under my user, which owns both the script and the spreadsheet that hosts it. 

When I look at the execution history, there's no failures. The spreadsheet has not been shared and there's no other copy of it. When I run the code manually, both from the code editor and from a button on the spreadsheet, it generally works without issues. A few times it asked me to authorize the user, so the authorization clearly had been revoked (no idea why), but most of the time it just works even though I keep getting those emails.

I checked the trigger restrictions and the only restriction that could even remotely apply is that the script might be taking more than 30 seconds to run. I checked the executions and the runtime is on average 5 seconds, with a few outliers around 20 seconds. Let's say that some runs might have taken longer because server load or whatever; wouldn't they show up as timed out in the list of failed executions (which is empty by the way)? Wouldn't the email report a timeout instead of a permissions issue?

Any ideas?

Jungle

unread,
Apr 28, 2023, 6:56:34 PM4/28/23
to Google Apps Script Community
Just to clarify, the triggers call functions within the script. I'm not doing anything other than interacting with the spreadsheet, getting cells, making calculations and setting cells. It's not deployed, there's no oauth happening, I'm not using any libraries or services or addons. The log shows nothing.
Reply all
Reply to author
Forward
0 new messages