414 Error for creating trigger for google app scripts - google-apps-script

I have some exisiting google app scripts in a spreadsheet of my google drive.
Tried to create a time driven trigger under Script Editor -> Resources to automate the execution of a script. Encountered error: 414. That’s an error.
The requested URL /... is too large to process. That’s all we know.
Read through some of the existing similar issues/solution. Nothing specific to time driven triggers found.
Anyone has a workaround ?

Have you tried running the script without the trigger? I find most times I get that error it's because I'm trying to add a trigger to a script that I haven't yet run and authorised first. Good luck!

Related

GAS onOpen() not running for copied spreadsheet

I have a spreadsheet with a script that includes onOpen() which successfully creates some custom menus. When I copied the spreadsheet (and the bound script of course), the onOpen() no longer runs. I tried a few things I found from other postings of the same problem:
Revoke the new spreadsheet's authorization - can't because it does not show up in my account as an authorized app.
Manually create a trigger for when the doc opens - I get an error "We're sorry, a server error occurred. Please wait a bit and try again."
Copied the script file itself and renamed it.
Renamed the enclosing script project.
Renamed the enclosing spreadsheet.
So, none of these has worked. Anything else I can try, or is there a known problem on Google's side?
Thanks!
I looked at the said issue tracker and found that the problem stemmed from this line of code:
DriveApp.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId());
To make this work, I would suggest to enable the Drive API in Resources -> Advanced Google Services. It will also ask you to enable Drive API in your Google Dev console. Do this and let me know if it worked for you.

All my news Google spreadsheets can't run a complex script

I've create a spreadsheet with a script for copy some other spreadsheet with a script inside, this worked fine for a moment.
But for several days all my scripts, on all news spreadsheets copied, they doesn't worked and they blocked when a complex line come (For example : DriveApp.getFileById(id))
(I say complex for script when onEdit, onOpen or other function can't run the line)
After somes researchs and reflexions, I think the problem come from the settings of my domain (G Suit), because when I use a new spreadsheet's script on an other account, they doesn't work, but if I use my old spreadsheet's scripts, they does work fine. I'm not sure.
The error messages I receive (it's when the script is out of time) are :
- An error has occurred on the server. We apologize and invite you to try
again later.
- Exceeded authorized execution time
I've tried to create a new spreadsheet and rewrite the script manually but I got the same error.
I'm not sure if it's only my domain, probably Google got some error too (But after 5 days it's strange).
Please, someone can help me, for say me if it's a problem with google, my domain or any other way.
(Sorry for my bad english)
Thanks in advance
Check the answer I've provided here.
You'll just have to enable Drive API for the project and from the Google Dev console.

how to stop a google apps script - have already revoked permissions

I ran the Drive Migrator script to try to move some files between 2 google accounts. It failed and kept sending me error emails, so I tried to turn it off by by revoking the Drive Migrator permissions inside my google account settings. Now I get a different email every day, saying that Drive Migrator failed to run because it requires authorization, so it is still running somewhere but I can't find any reference to it in my google account settings. The error email contains a link where I am supposed to be able to configure triggers for the script, but the link just loads a "Forbidden Error 403" page.
Thanks
Open Google Apps Script (can be any script). Remove any triggers that fire the migrator. Revoking the permissions would only cause an error message to be sent out, as the script will try to run due to the trigger. It tries to get through the oAuth and fails, causing you to receive the error.
A trigger is the only thing you need the script to attempt to run. Authorization is needed to actually perform some of the tasks in the script. Heck, some scripts can be run automatically with no authorization whatsoever. Always get rid of any triggers you no longer need.
Try this:
Go here:
https://security.google.com/settings/security/permissions
Scroll down and select "Drive Migrator" then select "Remove".
(It was mentioned in the app reviews)
I went to the respective script and just added /* and */
/*
script here
*/

Stopping the error "Authorisation is required to perform that action" in Google Apps Script

I keep getting this error message when I try to view my deployed app.
Authorisation is required to perform that action
How do I get around the error?
Services in use in the script:
ScriptDB
UiApp
(I think that is all)
I can't find the answer in the documentation, so I would be very grateful for some help.
You need to go the script editor and attempt to run any function manually first.
A first authorization popup is shown when you first deploy as web app, but if you go and change the code accessing new services you have to re-authorize it.

Deleted script, no triggers, still getting emails

I deleted a google apps script from docs (Gmail Snooze), but I keep getting a message every day:
Start Function Error Message Trigger
6/9/12 12:49 AM myFunction We're sorry, a server error time-based
occurred. Please wait a
bit and try again.
I've already tried creating a new script, going to Resources > All Your Triggers, and nothing is there.
Is there a better way to get rid of these error messages than creating a new filter in gmail to auto delete them?
Have you also tried deleting the spreadsheet from the Trash in Google Docs?
There have been some reported problems around deleting triggers. You may want to add a comment on this open issue.
This worked for me!
Open a spreadsheet then go to tools-spreadsheet editor, then on the
editor window go to Resources->All your triggers... and see if the
trigger is still listed there. If so, delete it.
Source: How to delete a google apps script service
There might be an update to the interface. Triggers are now accessible trough different menu.
Open script.google.com and open any project or create a new one if you don't have any projects. Then go to Edit>All your triggers and switch off the ones you don't need.