Strange Google Appscript Error "Must only be whole numbers." - google-apps-script

Amateur here.
An image above shows the Logger.log() being performed at the very end of the code. Yet somehow it gives off an Error that I cannot search up in Google (First time Googling can't help me, yikes)
Has anyone gotten a clue? A week ago, it worked perfectly fine before I temporarily abandon the project to focus on other real-life matters. Came back and re-ran the thing without any edit, and this error shows up.
Unfortunately I am very uncomfortable sharing the code - this Appscript utilizes a Google Spreadsheet that automates all the data and numbers for a "roleplaying game" that involves numbers related to money and purchasing. It's closest counterpart would be DnD, but it's much different, more embarrassing, and arguably more confusing when trying to explain it. If however I need to share the whole code for debugging purposes (200 lines), then I will.

Related

Is it possible to get a full Gmail history and export it on a Google Spreadsheet?

Big premise: I know nothing about coding, but I think it may be the solution. I apologize in advance for any rookie mistakes regarding the matter (also spelling ones, as english is not my first language).
Background: very important emails have been deleted from an institutional account, even from the trash. I've managed to restore them by the Gmail Admin Console, via "restore data" option.
Retrieving said emails wasn't an issue.
Proving that those email were deleted in the first place, however, it is.
Looking for solutions day and night, I stumbled upon Gmail APIs, especially something called users.history.list. I had no luck in obtaining valuable results (again, I know nothing about coding).
So, my question is:
Is there a way to get a full Gmail History, proving that those emails were deleted in the first place, and export said results somewhere (ig. a Google Spreadsheet)?
I'm asking because legal action has to be taken, and this could be a start.
Thank you in advance, again, I apologize if this is not the right format but i runned out of ideas at the moment...

Service using too much computer time for one day

This indicates that the script exceeded the total allowable execution time for one day. It most commonly occurs for scripts that run on a trigger, which have a lower daily limit than scripts executed manually. The limit as far as I am aware is 6 hours per day. None of my scripts run for that long.
Everything was fine earlier. Suddenly, over the last 3-4 days, all the scripts have started failing. I have no clue what's happening. My only hunch is that one of my scripts is going into an infinite loop. But still, if that happens, it will fail soon and collectively, all scripts would not run for 6 hours.
Please help to resolve this issue. I have a G suite id but Google mentioned that I get help at stackoverflow and that they cannot help.
The exception message should also tell you a lot about what is happening. If you are not sure which script is causing the issues you can try to go to the Google Apps Script Manager. In the menu bar on the left you will see a section called My Executions. If you click that you can see a list of scripts that ran and how long they ran for. This page also allows you to sort by duration and filter the results to hopefully help you figure out what is going on.
It possible that you have reached your quota. Having a Google Suite account allows you up to 6 hrs/day of Trigger Total Runtime. Also make sure you are not going over the limit on single script runtime as outlined here further down on the Quota For Google Services page.
For Google Suite Accounts the quota is:
Script runtime: 6 min/execution
Custom function runtime: 30 sec/execution
I had a similar problem. It's a little maddening because getting an error for the script leads one to believe it is a possible syntax problem. More likely, the script never ran in the first place, which is why you likely don't have a failed execution status for the trigger. What may have happened instead is that you have a script or scripts that are still firing for documents that no longer exist.
Navigate to "My Triggers" in the G Suite Developer Hub: https://script.google.com/home/triggers
Click on any time-based events and select "executions."
Search the "status" column for the words "Timed out," and check the duration.
Delete the trigger(s) that is timing out, or otherwise resolve why it is timing out (such as restoring the deleted document).
In my case, I had deleted several old spreadsheets, but one of my add-ons (Supermetrics) was still firing triggers. I had incorrectly assumed that when I deleted my spreadsheets the triggers would have gone with them. Instead they were firing and timing out after about six minutes, and then four hours later they would try to execute again. I added up the duration for all of these triggers and, sure enough, it exceeded my quota.
Delete those old triggers, and you'll likely be back within your quota limits the next day when it resets. This is what worked for me, but I imagine it's not a one-size fits all solution.

Google App Script trigger is not firing

I am a Google App Script user since last 2 years. I see here in India during peak time i.e during evening the 1 minute trigger is not firing at proper time. Is there any server side issue or there is some other issue. Saying about the worse case scenarios, today my script trigger has not been fired since past 2 hours. I have correctly done logging. No log is printed means it does not even go to that method. Can anybody tell me what might be the exact reason behind it.
It might be beneficial to show us the code behind your script, given that there is a method that is potentially being skipped over. Have there been no errors thrown to you via the Google Apps Script notifications?
It seems, perhaps, your issue may fall into place with this currently reported error: https://code.google.com/p/google-apps-script-issues/issues/detail?id=2708
We're likely not going to be able to give you a precise answer to your problem if we can't examine what you're currently working with. I wish you luck in your endeavor, though.

Slightly Slow Approval to the Gallery, non-removal of existing script

So, I have to make a minor bug fix to all of my scripts: I didn't realize there was a limit to the amount you could push into the Cache (BTW Google, I'm pretty sure this isn't documented anywhere).
Anyhow, so my three line fix resulted in my having to resubmit a bunch of scripts. Typically this isn't a big deal, Google is usually super awesome about approving them (usually the next business day). However, unfortunately they seem to be taking more time this time. This became a problem because I had to do a presentation today, and I just assumed they would be approved by now (I fudged it and just showed a spreadsheet with the script already installed).
So, I guess my main question here is maybe would have a more graceful upgrade process? It sometimes doesn't make sense to have the script removed from the gallery when waiting for approval.
Thanks!
Ben
I've opened an issue a while ago regarding this (nearly 2 years now). You probably want to star it to keep track of updates.
About the approval process, it is not "reliable" as you could see. I had scripts that took 3 months to be re-approved and then, the next upgrade, only a couple of days.

Facebook.login callback fires multiple times

I'm using the AS3 SDK and running into a weird issue. I do something like the following:
Facebook.init(MY_APP_ID, someHandler);
This works ok. At some later point as a result of a user clicking a button in a swf, I do:
Facebook.login(someOtherHandler, {perms:"offline_access,publish_stream"});
Following the user login/approval in the FB popup window, the "someOtherHandler" method is called, but the problem is it is getting called many times - like upwards of 150. In Firefox this is annoying but still works, and I'm then able to make other calls to the API (lookup their account info, post to their wall, etc.). In IE however, this typically leads to a stack overflow. And honestly, even in Firefox this isn't something I want to live with.
If I do a barebones "hello world" type example to try to reproduce the problem I can't; there the callback only fires the expected single time. I'm trying to isolate what could be causing the callback to be called again and again but the system I'm integrating this into is quite large and so it's taking a very long time. That's also why I'm not posting the real code which I know will make it harder for anyone else to help out, but I'm hoping someone's been down this general road before. Thx.
(EDIT - I have verified that Facebook.login is in fact only being called a single time)