I have a spreadsheet script using google spreadsheets that was firing on a daily trigger. Everything was running fine until a few days ago and suddenly it stopped working. The script sends me an email every day, around midnight. I was able to send a test email today but the operation that pulls data from my spreadsheet doesnt seem to be able to send the email. Ran it through the debugger and everything appears to be working fine. Does anyone know why something like this might happen?
First, you need to figure out whether or not your trigger is being invoked. If yes, click on notifications in the triggers window to set it up so that you receive an error email immediately. This way you'll see if your script gets any errors which might be useful in determining the next step.
Related
I designed a rather simple Add-On to enable my local team to more easily automate newsletters and target updates to Slack.
The Add-On works well, aside from two issues:
Schedule a send functionality.
I'm using the ScriptApp's newTrigger() function to allow users to schedule automatic sends.
While it seemed to have worked in original tests, the triggers are now triggering at the wrong time (a trigger that should run daily from 11-12AM has been running at 5PM - Another that should run at 6PM has been running at 12AM - I've checked and the timezones appear to be correct GMT+2 for Paris)
GetActive() returning the wrong sheet
This is a minor problem as I've only noticed it twice, but when running a script with getActive() from the correct sheet, it accidentally ran the script using another spreadsheet.
I remain at your disposal should you need any more information, IDs or the likes.
Thank you for any help and have a fantastic day
I have a Google Script running every 5 minutes. It works except randomly there are sudden crashes and the script/trigger won't survive that. So, for many different reasons, the script stops running after some weeks of continuing runtime. At this point, I would need a notification.
How can I get a notification if a function (script) hasn't run in say 2 hours? Doesn't matter what the technique/notification is, but probably email would be great for the notification. I don't think the solution can be in the script code itself, because the script randomly (every few weeks) crashes at Google's side and there's nothing I can do about that.
Google Apps Script installable triggers automatically set an email notification. You could edit when it should be sent (i.e. send immediately) and you could add more notifications. NOTE: This can only be done manually.
The above will work for "normal" failures but it there is a service outage or other platforms failures the notification might not be sent.
One option is to log the executions somewhere then set a second trigger to check that the first trigger ran every time that it should do it as expected. NOTE: The failure that prevented that the first trigger run might also prevent that his second trigger run i.e. a service outage so you might want to set other monitoring measures accordingly the the severity/priority of this failure and your project budget.
Hello I have created a simple Google Docs where my colleagues can input information on the roster everyday. Now, everyday, before 10 am they will have to finish putting data in. After 10 am my Time-Driven Apps Script Trigger runs and converts this google docs document into a pdf file and sends it out to specific emails.
This was working fine for the past two months. But Yesturday, All the sudden, app script sent out the same email like 5 times within 2 minutes. I have attached my code, the trigger I set on app script and my executions. Would you please take a look? Because right now I am pulling my hair and not even sure whats going on or how I can fix this.
My Triggers no longer work. I have two different google sheets with triggers setup. One sheet has a daily trigger that is set to fire between 9-10am. The other sheet has two triggers, one fires on a form submit and the second trigger fires on change. These had been working fine for a solid year before they up and stopped working a week or two ago.
For both of the google sheets, I have tried deleting and re-adding the triggers. For the one that has the daily timer, I have tried changing the time of day around also. No luck on them firing own their own. If I go to the Run Menu and run the function manually it works fine. I'd rather avoid having to create new google sheets as links to these sheets are published to users in my domain and are in production.
ie.
function updateScores()
{
Logger.log("Function started");
/*
all of my code here....
*/
}
When I manually run the function I see the "Function started" message in the logs along with all my other Logger.log statements I have throughout the code. Calculations are done correctly, emails sent, etc. The code itself works fine.
Actually, I've seen a couple of issues regarding triggers not working posted just recently in google-apps-script-issues tracker - Issue 6226 and the latest is Issue 6244.
As advised in this SO post - Google app script trigger not working, after checking the logs which you already have done and as you mentioned "The code itself works fine", you may post the issue in Apps Script Issue Tracker .
Our spreadsheet scripts have not changed in 3 months. As of yesterday we get the error "Error encountered: we're sorry a server error occurred Please wait a bit and try again" when clicking the submit button on a particular function that has worked flawlessly for 3 months. Nothing has changed, and this was verified by viewing the script revision history. In addition, other functions are giving problems, like, "Cannot find function trim() in object...." - again, this has always worked fine.
The only thing that has changed was that, for the documents in question, we had removed 1 user and readded a user (gmail address) yesterday morning and shortly after users began reporting this issue. I don't believe I had ever removed a shared user before yesterday, by the way.
Is my only recourse to recreate the sheets??? Again, there have been no changes to this script and it worked flawlessly until I removed a user from sharing.
Thanks.