Skip to main content

A web trigger answers with an error status

What each error status from a Script Master web trigger means, and how to fix it.

Symptom​

A call to a web trigger's URL gets an HTTP error status instead of your script's response. The response body is JSON with statusCode and statusText.

Find the cause​

Look at the status code and statusText, then go to the matching cause:

StatusstatusTextCause
400Web Trigger "id" is not providedThe URL is missing the web trigger's id
403Web Trigger "…" cannot be executed, because it is disabledThe web trigger is turned off
404Web Trigger is not found by "id"The web trigger was deleted, or the id is wrong
429Too Many Requests. You're doing that too often! Try again later.Too many calls at once
500Internal Server Error. The web trigger script failed.The script failed
500The web trigger with "…" returned results without the required "statusCode" property. Please check the documentation for the expected return value.The script returned no response
503Service Unavailable. The current version of the app is outdated.The app version is outdated

The URL is missing the id​

Cause: Every Script Master web trigger is called through the same address, with ?id= naming which one to run. The caller dropped that parameter.

Solution: Copy the URL again from the web trigger in Script Master, and keep the whole query string when you add your own parameters.

The web trigger is turned off​

Cause: The web trigger is off. Someone turned it off, or it was duplicated or imported: copies start off.

Solution: Turn it on again on the Web Triggers tab.

The web trigger was deleted, or the id is wrong​

Cause: No web trigger has that id. It was deleted, or the URL belongs to another site. A malformed id can also get 424 instead.

Solution: Check that the web trigger still exists, then copy its URL again.

Too many calls at once​

Cause: Script Master limits calls to about 10 in 20 seconds for all web triggers of a site, to stop runaway loops. See Limits.

Solution: Space out the calls, or send several changes in one call. Retry a refused call after a short wait.

The script failed​

Cause: The script threw an error, or couldn't run. The caller gets no details, so nothing internal leaks. The run's error is in the web trigger's history.

Solution: Open the web trigger's History in Script Master and read the run's error. If it says Local script execution is not supported., see Server-side modules show "Action Required". If it starts with Remote execution failed, see A run fails with "Remote execution failed".

The script returned no response​

Cause: A web trigger script must return an object with at least statusCode. This one returned nothing, or something else.

Solution: End the script with a response object:

return {
statusCode: 200,
headers: { 'Content-Type': ['application/json'] },
body: JSON.stringify({ ok: true }),
};

The app version is outdated​

Cause: The version of Script Master on your site has been retired.

Solution: See This version is outdated.