Availability Is Currently Limited Please Try Again Later

Fifty-fifty the most experienced programmer rarely writes code correctly on the first try, making troubleshooting an important part of the development process. In this section nosotros'll comprehend some techniques that tin aid you find, sympathize, and debug errors in your scripts.

Fault letters

When your script encounters an fault, an error bulletin is displayed. The bulletin is accompanied by a line number used for troubleshooting. At that place are two basic types of errors displayed in this way: syntax errors and runtime errors.

Syntax errors

Syntax errors are caused past writing code that doesn't follow the JavaScript grammar, and the errors are detected every bit before long as you try to salvage the script. For example, the following lawmaking snippet contains a syntax error:

          function emailDataRow(rowNumber) {   var sheet = SpreadsheetApp.getActiveSheet();   var data = sheet.getDataRange().getValues();   var rowData = data[rowNumber-i].bring together(" ";   MailApp.sendEmail('john@example.com',                     'Information in row ' + rowNumber,                     rowData); }                  

The syntax problem here is a missing ) character at the end of the fourth line. When you try to save the script you'll get the following error:

Missing ) after argument list. (line 4)

These types of errors are usually simple to troubleshoot, since they are found correct abroad and typically have elementary causes. You aren't able to save a file that contains syntax errors, meaning that only valid code is saved into your project.

Runtime errors

These errors are caused by using a function or class incorrectly, and tin can only be detected once the script has been run. For example, the following code causes a runtime fault:

          function emailDataRow(rowNumber) {   var canvas = SpreadsheetApp.getActiveSheet();   var data = canvass.getDataRange().getValues();   var rowData = information[rowNumber-1].join(" ");   MailApp.sendEmail('john',                     'Data in row ' + rowNumber,                     rowData); }                  

The code is formatted correctly, only we are passing the value "john" for the e-mail accost when calling MailApp.sendEmail. Since this is non a valid e-mail address the post-obit error is thrown when running the script:

Invalid email: john (line v)

What makes these errors more than challenging to troubleshoot is that often the information you lot are passing into a function is non written in the code, but instead pulled from a spreadsheet, form, or other external data source. Using the debugging techniques below can help you to place the cause of these errors.

Mutual errors

Below is a list of mutual errors and their causes.

Service invoked as well many times: <activeness name>

This error indicates that you take exceeded your daily quota for a given activeness. For example, you might run across this fault if you send as well many emails in a single mean solar day. The quotas are prepare at different levels for consumer, domain, and premier accounts and are subject to change at any time without a prior announcement past Google. You can view the quota limits for diverse actions in the Apps Script quota documentation.

Server non available. or Server mistake occurred, please try again.

At that place are a few possible causes for these errors:

  • A Google server or system is temporarily unavailable. Expect for a few moments and effort running the script again.
  • In that location is an mistake in your script that doesn't have a corresponding mistake message. Try debugging your script and see if you can isolate the problem.
  • There is a issues in Google Apps Script that is causing this error. For instructions on searching for and filing problems reports, see the Bugs. Before filing a new bug, search to see if others have already reported information technology.

This mistake indicates that the script is lacking the dominance needed to run. When a script is run in the Script Editor or from a custom menu item an authorization dialog is presented to the user. However, when a script is run from a trigger, embedded with a Google Sites page, or run as a service, the dialog cannot exist presented and this error is shown.

To qualify the script, open the Script Editor and run any part. The say-so prompt appears and then you tin authorize the script project. If the script contains new unauthorized services, you must re-qualify the script.

This error is ofttimes acquired by triggers that are firing before the user has authorized them. If you don't take admission to the script project (because the error is occurring for an add-on y'all use, for example), you can commonly authorize the script past using the addition again. If a trigger continues to fire and cause this error, you can remove your triggers past doing the post-obit:

New editor

  1. At the left of the Apps Script project, click Triggers .
  2. At the right of the trigger you want to remove, click More than > Delete trigger.

Legacy editor

  1. Select Edit > All your triggers in the Apps Script editor. The resulting dialog shows all active triggers running on your account.
  2. Find the offending trigger in the listing.
  3. Click the icon next to the trigger proper name to remove it.
  4. Click Salvage to record the deletion.

You can besides remove problematic addition triggers by uninstalling the add-on.

Access denied: DriveApp or The domain policy has disabled third-party Drive apps

Administrators of Google Workspace domains have the power to disable the Drive SDK for their domain, which prevents their users from installing and using Google Bulldoze apps. This setting also prevents the users from beingness able to employ Apps Script add together-ons that utilize the Drive service or Advanced Drive Service (even if the script was authorized prior to the admin disabling Drive SDK).

Nonetheless, if an improver or web app using the Drive service is published for domain-wide installation and is installed by the administrator for some or all users in the domain, the script functions for those users even if the Drive SDK is disabled in the domain.

The script does not have permission to get the active user's identity.

Indicates that the active user'south identity and email are not available to the script. This warning results from a call to Session.getActiveUser(). It can also outcome from a phone call to Session.getEffectiveUser() if the script is running in an authorization way other than AuthMode.Full. If this warning is signaled, subsequent calls to User.getEmail() only render "".

There are a number of ways to troubleshoot this warning, depending on the authorization manner the script is running under. The say-so mode is exposed in triggered functions as the authMode property of the e event parameter.

  • In AuthMode.Full, consider using Session.getEffectiveUser() instead.
  • In AuthMode.Express, ensure that the possessor has authorized the script.
  • In other authorisation modes, avoid calling either method.
  • If yous are a Google Workspace customer newly experiencing this warning from an installable trigger, ensure that the trigger is running as a user within your organisation.

Library is missing

If you add together a popular library to your script, you might receive an error message stating that it's missing, fifty-fifty though the library is listed equally a dependency for your script. The reason might be that too many people are accessing the library at the aforementioned time. To avert this error, try i of the following solutions:

  • Copy and paste the library's code into your script and remove the library dependency.
  • Copy the library script and deploy information technology as a library from your business relationship. Be certain to update the dependency in your original script to the new library instead of the public one.

Debugging

Non all mistakes cause an error message to be displayed. There might be a more subtle mistake where the lawmaking is technically correct and can execute, but the results are non what you await. Here are some strategies for treatment such situations and further investigating a script that is not running the way you lot expect.

Logging

While debugging it's often helpful to record data as a script projection executes. Google Apps Script has two methods for logging information: the Deject logging service and the more than basic Logger and console services that are built in to the Apps Script editor.

See the Logging guide for more than details.

Error Reporting

Exceptions that occur because of runtime errors are automatically recorded using the Google Cloud Error Reporting service. This service lets you search and filter exception messages your script projection creates.

New editor

To admission Fault Reporting, run into View Cloud logs and error reports in the Google Cloud Platform panel.

Legacy editor

You can enable Error Reporting the start time you select View > Stackdriver Logging or View > Stackdriver Fault Reporting in a new script.

Once enabled, exceptions that occur because of runtime errors are automatically recorded using the Google Deject Stackdriver service. This service lets you search and filter exception messages your script projection creates. Yous can accomplish the Stackdriver Error Reporting interface past selecting View > Stackdriver Error Reporting in the Apps Script editor.

Executions

New editor

Every time yous run a script, Apps Script makes a record of the execution, including the Cloud logs. These records tin can help you understand which deportment your script performed.

To view the executions of your script in the Apps Script project, at the left, click Executions .

Legacy editor

Every time you run a script, Apps Script makes a record of the execution, including the Cloud logs. These records tin can assist you to empathize which deportment your script performed. To view the executions of your script, select View > Executions in the Apps Script editor. This opens the Executions panel for the script in the Apps Script dashboard.

Checking Apps Script service status

Although rare, sometimes specific Google Workspace services (such every bit Gmail or Drive) see temporary problems that tin lead to service outages. When this occurs, Apps Script projects that interact with these services may not part every bit expected.

You tin check if there is a Google Workspace service outage by viewing the Google Workspace Status Dashboard. If an outage is currently being experienced, you either expect for it to be resolved or seek boosted help in the Google Workspace Help Eye or the Google Workspace Known Issues documentation.

Utilize the debugger and breakpoints

To locate problems in your script, you can run information technology in debug way. When run in debug mode, a script pauses when it hits a breakpoint, which is a line you've highlighted in your script that yous think may accept a problem. When a script pauses it displays the value of each variable at that signal in time, allowing you to inspect the inner workings of a script without having to add a lot of logging statements.

Add together a breakpoint

New editor

To add together a breakpoint, hover over the line number of the line you want to add the breakpoint to. At the left of the line number, click the circle. The below image shows an example of a breakpoint added to a script:

Add a breakpoint

Legacy editor

To add a breakpoint click on the line number for the line you want to pause at.

Run a script in debug mode

New editor

To run the script in debug mode, at the top of the editor click Debug.

Before the script runs the line with the breakpoint it pauses and displays a table of debug information. Y'all can use this table to inspect data like the values of parameters and the information stored in objects.

To control how the script is run, at the top of the Debugger panel, use the "Stride in", "Pace over", and "Step out" buttons. These let you run the script ane line at a fourth dimension and audit how values modify over time.

Legacy editor

To run the script in debug style, click the issues icon (Bug icon) in the toolbar. Before the script runs the line with the breakpoint it pauses and displays a table of debug information.

This table allows you to audit the values of the parameters like row and electronic mail, equally well as the data stored in the information object. Detect that the rowData variable doesn't have a value assigned yet, because the script paused before that line was executed.

When the script is paused, an extra set of buttons are displayed in the toolbar which allow you to control how the script is run. Using the "step in", "footstep over", and "step out" buttons you lot can run the script one line at a time, assuasive y'all to inspect how values change over time.

Issues with multiple Google Accounts

If yous're logged into multiple Google Accounts at the aforementioned fourth dimension, you might have trouble accessing your Apps Script projects, add together-ons, and web apps. Multi-login, or being logged into multiple Google Accounts at once, isn't supported for Apps Script, add-ons, or web apps.

To fix issues from multi-login, try i of the following solutions:

  • Log out of all your Google Accounts and only log in to the one that has the Apps Script project, improver, or spider web app you need to access.
  • Open an incognito window in Google Chrome, or an equivalent private browsing window, and log in to the Google Account that has the Apps Script project, improver, or web app you need to access.

Getting help

Debugging a problem using the tools and techniques listed above can solve a variety of bug, but at that place may exist issues y'all run into that require some extra assistance to solve. Encounter our Support page for information on where to ask questions and file bugs.

lombardseemorger44.blogspot.com

Source: https://developers.google.com/apps-script/guides/support/troubleshooting

0 Response to "Availability Is Currently Limited Please Try Again Later"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel