We make substantial use of Google Apps Script, and today I saw this error:
UrlFetch failed because too much upload bandwidth was used in Code (gci standalone script):219
I found lots of links to Google Apps Engine quotas, and how to check Apps Engine quota usage. However the Apps Engine quotas all showed as 0 in the Google Cloud developers console. This is not surprising since we don't use Apps Engine, but I was unable to find a similar breakdown for Google Apps Scripts.
Is there one?
On another note, this question: Are there quotas for incoming requests to a Web App?
has an answer:
urlFetch quotas do not apply unless you are making the call to the spreadsheets api v3 directly without spreadsheetApp.
We use UrlFetch to retrieve CouchDB data. I would like to monitor the amount of quota for this service that we use. Is there a way to do so?
You can call the quota for the send emails quota but don't think you can do it for urlfetch.
Related
We make substantial use of Google Apps Script, and today I saw this error:
UrlFetch failed because too much upload bandwidth was used in Code (gci standalone script):219
I found lots of links to Google Apps Engine quotas, and how to check Apps Engine quota usage. However the Apps Engine quotas all showed as 0 in the Google Cloud developers console. This is not surprising since we don't use Apps Engine, but I was unable to find a similar breakdown for Google Apps Scripts.
Is there one?
On another note, this question: Are there quotas for incoming requests to a Web App?
has an answer:
urlFetch quotas do not apply unless you are making the call to the spreadsheets api v3 directly without spreadsheetApp.
We use UrlFetch to retrieve CouchDB data. I would like to monitor the amount of quota for this service that we use. Is there a way to do so?
You can call the quota for the send emails quota but don't think you can do it for urlfetch.
I have scripts that I made with Google script editor. Basically what my scripts do is make and change google SpreadSheets, Slides, and Docs. It is logical that Google puts a limit on the amount of computing that you can do. The error that I get is this:
Error in Apps Script executions Overview
My question is how can I bring my scripts to Google Cloud Platform and pay for the computing power? So that I can finish my work. I am not sure where to start in the Google Cloud Platform. Or can I use my own computer as computing power?
Any Help, tips, or tricks are welcome, 😅 Thank you 🙏
Google Apps Scripts are already part of your default project in Google Cloud Platform, and it is GCP that manages your quota for services and API's that are being executed in those scripts.
Please check your codes, identify areas in which there are a lot of API executions, and try to optimize, for example, removing API calls within loops, etc. Here is a reference of quotas that are managed in GCP for Apps Script:
Quotas for Google Services
If the code is already optimized, then you can apply for increased quota here:
Monitor API Quotas
I noticed that the Google Apps Script editor uses a Bearer token to make requests for a lot of things, that got me thinking: Is it possible to do all functions that are done with the google apps script with the google API on your own server? What is the essential difference? Just the fact that google apps script runs on google servers, while with the google API you would need to create your own servers?
For example many of the document functions, which I thought could only be done with the API, turns out can be found here https://developers.google.com/docs/api/reference/rest/v1/documents/request#InsertInlineImageRequest
so whats the essential difference?
Just the fact that google apps script runs on google servers, while with the google API you would need to create your own servers?
Yes. There are advantages to both methods:
API:
It's a rest API. You can use your own language(eg: Python) in your servers.
The api is more inclusive. There are stuff which can be done with the api, which cannot be accomplished with apps script.
User can set limited scopes for using API.
For example, at Drive API, https://www.googleapis.com/auth/drive.file can be used for Drive API. The same cannot be done with DriveApp of apps script.
Process cost of API is lower than that of the built-in methods for Google Apps Script1 2
Apps script:
No server on your side
Triggers. You can set up functions to run onEdit,onOpen or at a specific time.
Deep integration with Google apps: Sidebars/modal dialogs can only be done with apps script.
All methods of the api can be accessed indirectly through the bearer token.
Authorization/authentication is taken care of by apps script. You don't need to set up oauth.
How can usage of Google App Script libraries like GmailApp, CalendarApp, and PropertiesService be tracked through the Google API Console?
While Google App Script projects do show up inside the API console, none of them show any activity when selected. I understand that individual Google APIs need to be enabled for a project in order for their usage to be visible in the API console, but none of the App Script APIs seem to be available in the list Google APIs to choose from.
My only guess is that Google App Script usage cannot in fact be tracked through the Google API Console, which is a shame since many users seem to hit their app script quota limits and would benefit from the ability to track and visualize their script's resource usage.
Yes, it is true that you cannot track the usage of individual libraries of Google App Script in the Google Developer Console except for the MailApp. The MailApp has a method of getRemainingDailyQuota() that returns the number of remaining emails a user can send for the rest of the day. You can check in this documentation the different quotas and limitations that you can do with the Apps script. I also suggest you to make a feature request about this issue.
I'm facing quota limits of sending mails via Google Apps Script. The limit is 100 a day. I called the support center, but they say the script is out of the scope of Google Apps Service.
They told me I could buy more quota at GCP (Google Cloud Platform), now my question: Do I have to code new scripts on the GCP, or can I somehow connect the Google Apps Script (which is part of Drive and Apps I guess) with GCP?
I'm not sure if you can link both projects, however, I think Apps script email service would still be limited by it's own quotas.
A possible workaround would be to call the Gmail API directly instead of using the Apps script Gmailapp service.
To call the API you can use the "UrlFetchApp.fetch()" to make the call to the Gmail send endpoint.
To be able to make the call to the Gmail API, you will have to enable it in the developer console, for this in your script go to "Resources -> Advanced Google Services". There you will enable the Gmail API, then you have to click on the link that says "These services must also be enabled in the Google Developers Console."
It will take you to the Developer Console of your Appscript project, there you also have to enable the Gmail API.
The quota for UrlFetch is 20k calls/day, so in this case you would be limited by this quota and the Gmail API quota.