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?