Search code examples
google-apps-scriptgoogle-sheetsinfinite-loopterminate

Google Script code running forever - How to terminate - calling Urlfetch constantly


I have a Google App script (GAS) add-on for Sheets in 'Google Workspace Marketplace'.
The Script calling Urlfetch to get data from our API.

One user created a sheet that now calling the API forever. The user does not have the sheet open in any webbrowser.

I can see in Logs that the API calls never stops. Over 20k every day. I talked to user and checked his sheet. There is no triggers or loops. On my account the users sheet works fine.

What can I do to stop this script from running forever, for this user?
Is any way in Google Admin to stop the script from running?

Any help is appreciated,

Br, Henrik


Solution

  • Your Apps Script file can "see" the code executions of your add-on users. You can also terminate executions.

    Open up the list of your projects: https://script.google.com/home/my

    Find the project that your add-on is based on.
    Click the 3 dots at the right.
    Choose "Executions"
    Click the "Add filter" button with the plus sign.
    Choose "Ran As".
    Choose "Anyone"
    Click Apply.
    You will see executions that are being run from your add-on users.
    Click in the filter address bar again to add another filter.
    Choose "Status".
    Click the "Running" checkbox.
    If you see a very long running execution, then click the 3 dots icon.
    Choose
    TERMINATE