google triggers stopped executing - google-apps-script

I have been using a number of triggers based on form submission to a google sheet. Since yesterday the triggers have stopped working.
I have
unlinked and re-linked the form and sheet.
created a new response sheet.
recreated my scripts,
tried macros ( its a simple operation to sort the google sheet responses and send the top most response to another sheet )
the form submit trigger doesnt work. so to test I setup time based triggers. they seemed to work but stopped at 5 am this morning.
I can run the script manually and works fine but triggers do not run.
There was nothing in the logs. each trigger just stopped firing
Can anyone advise ?
Many thanks

I'd like to confirm the issue
Problem
installable trigger onFormSubmit from GoogleSheet stopped executing.
installable trigger onMinute from the same Spreadsheet still working and showing logs.
Logs are empty here:
https://script.google.com/home/projects/PROJECT/executions
Solution?
My attempts to resolve the issue:
Delete and create trigger again
Change the source code
Create 2 same triggers.
Possible other tests:
Create trigger from another account
Create a trigger with no code to test if it could execute at all.
Conclusion
In the end, one of my newly created triggers started the execution again.
I do not know what fixed the problem: changing the function text OR creating/deleting triggers OR some external fix on the Google side.
If some have more issues, please report the issue here:
https://issuetracker.google.com/savedsearches/566222

Related

Apps script authorization for openId don't work with onEdit(e) trigger

I have a problem with a google sheet script, I would like to transfer data from one workbook to another using an onEdit trigger, but when my trigger fires, I have a message of error in the execution log which says that I do not have the authorizations to access this file, however when I do the same action but without trigger (by activating the function by hand) it works without problem. I don't know at all where the problem comes from, if someone can help me it would be really appreciated because I'm desperate (I found absolutely nothing on google after hours of research), thank you in advance for your help and have a nice day.
Joseph Menard
(PS; I am attaching a link to a video of my screen showing my problem ;
https://www.loom.com/share/f1a0fde043f74143b7caad78ae806be6 )
I assume you are using a simple onEdit trigger? Simple triggers run without authorisation from the user and are subject to several restrictions. Instead ty using an installable onEdit trigger and see if that helps?

Issue with Google Scripts Time-Based Trigger in Sheets addon always Failing

I'm having an issues with a "Sheets Addon" i am working on. I know how to create triggers in a normal script, but what I'm trying to do is create a trigger within an Addon that will call back to a function within that same addon. I want this to be a timed based trigger, every 1 or 2 hrs as the options.
If I create the trigger via sheets scripts, it all works fine, but using the same exact code for the addon.. it fails 100% of the time, but with no specific error, or at least not that i can get to easily.
I'm assuming there is something different to be add to the code to make a new trigger code work within an addon, but not sure what it is. any help would be greatly appreciated.
EDIT 12/4/2019::
example snippet... if i place this into the sheets script, and run it (from the sheet and not from the addon) it works fine. The trigger gets added and calls to the function with no issues. However when i run it from the sheet via the addon, the trigger still gets created but error our when processing.
function testCreateTrigger() {
ScriptApp.newTrigger('testRunTrigger')
.timeBased()
.everyHours(1)
.create();
}
One thing i'm noticing is that the Trigger for the sheet (non-addon) is created with Project name, Deployment, Event, Function ... all populated, but when i run it via the addon, the Deployment is blank.
Also installed the google salesforce addon which has a schedule feature which adds as a trigger, but that addon somehow creates the trigger with a "Blank" value for Project, Deployment, and Function ..but still knows what function within the addon/script to call to process. I think that's what I'm missing, how to create a trigger, from a function, within an addon.

Google Apps Script onEdit() trigger not executing

I have been implementing a spreadsheet for about a year and a half now that constantly runs a number of trigger based GAS functions to check data, send emails based on that data, and update a staff calendar.
All of the time driven triggers are executing normally. I have not had an issue with them. However, the spreadsheet driven triggers (onEdit, onChange) are not working at all. I left work for a two week vacation and I did not change the script at all. When I came back, it no longer worked.
I deleted the trigger, recreated it, and switched between onEdit and onChange; the trigger will still not fire. The function that is triggered on edit is dependent on the event for it to execute properly. I test ran the function outside of the trigger and it failed where I expected it to (where the event dependant variables are) so there was no surprise there.
As far as I can tell, the spreadsheet driven triggers just won't fire at all. Does anyone know of any issues on Google's end, are spreadsheet driven triggers working for any of you guys? As far as I can tell the trigger just stopped working all together.
If I explicitly nest my function inside the onEdit() function in the script, it will execute, it won't if I just create a trigger, however it throws an error saying that the script does not have the permissions to execute MailApp.sendEmail() even though the app is already authorized to send emails as me.
Even more interesting, the functions executed with time driven triggers are still able to send emails and update my calendar.
It seems like the spreadsheet driven triggers have quit working all together.
Just to be clear I did not make the mistake of naming my function onEdit or onChange.

Google Apps Script Triggers not firing

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 .

Can't Locate/Delete an Installable Trigger

I installed a form submit trigger for my project using ScriptApp around the beginning of May. The trigger has worked just fine however I now wish to uninstall the trigger and am running into problems. When I try to view all my current project triggers (Resources > Current project triggers), it returns that there are no associated triggers. Also when I try to run (Resources > All your triggers) it returns that there are no triggers shown.
I'd like to believe that this is the case, that the trigger in question has been somehow deleted but I don't believe that it is. To make sure the trigger didn't run, I de-authorized the script to run from my google account settings.
My suspicions that the trigger was not deleted were confirmed when I received a "Summary of failures for Google Apps Script: Form Processing Script" which told me my script had failed 3 times because, "Authorization is required to perform that action."
These failure e-mails also contain a statement, "To configure the triggers for this script, or change your setting for receiving future failure notifications, click here." When I click on the link, there are no triggers shown...
Here's a look at the code i used to install the trigger:
function formSubmitTriggerInstall() {
var formID = '1rOikLDUAqMWCB0ktjWzFE0oB6LmOHvXuzPAqyq0XLwE';
ScriptApp.newTrigger('processForm')
.forForm(formID)
.onFormSubmit()
.create();
}
I have also tried to locate the trigger using ScriptApp but to no avail.
Does anyone have any suggestions on how I can eliminate this trigger or get the associated trigger ID?
One other note, since I installed the trigger, the google developer's website and documentation went through a major face lift and some of the page content appears to be updated as well. Not sure that would affect my triggers though.
It was confirmed that this was a big and it was fixed by the apps script team.