CorefinityCorefinityDocs
Open the Control PanelControl Panel
Error pages · 4 of 8

corestack_error_pages_update

Change an environment's error pages.

Scope writeRuns as a taskNo secrets returned
On this page

When to use it

Change an environment's error and maintenance pages, with the version that corestack_error_pages_get answered. Check any new HTML with corestack_error_pages_validate (or corestack_error_pages_preview) first.

Send only what changes; everything you leave out keeps its current value:

  • codes: for 404, 500, 502, 503 and 504, page shows the error page (ours, or your HTML) in place of the app's response, with the status code unchanged; app lets the app's own response through. When nginx itself has to answer (PHP not running gives 502, a request over 300 seconds gives 504) there is no app response: page shows the error page and app shows nginx's plain page.
  • 503 also decides what happens during deploys and platform maintenance: page shows the maintenance page, app lets requests reach the app. The Maintenance switch in the Control Panel and a full stop by Corefinity support always show the maintenance page, whatever this setting.
  • pages: for maintenance, 404, 500, 502, 503 and 504, source is your HTML and CSS (null puts the platform's page back) and message is the {{message}} text (null puts the default back).
  • support_email: the {{support_email}} address; null clears it.

Pages are HTML and CSS only. The save removes anything a page may not hold (scripts, event handlers, links that are not https:, mailto: or images, iframes, forms) and keeps the page without it. When the app answers an API request (paths such as /rest/, /graphql, /wp-json/, or a request asking for JSON), its response always passes through; an error the web server answers itself on such a request (PHP not running, a request over 300 seconds) follows the settings.

The save is checked, written to the site and verified. The answer is a task on its error_pages_change operation (follow it with corestack_site_operation_get). The finished task's result carries error_pages: outcome is applied (the new pages are live and the site confirmed them), applied_unverified (live, but the site could not confirm them), rejected (the site refused the change and kept its previous pages; the task fails) or unknown (not known yet; it is checked again shortly). applied is true while the new pages are live, verified when the site confirmed them.

A change equal to the current pages answers {operation: null, revision: null}. After rejected or unknown, retry: true with the version applies the current pages again. 20 changes a minute for each environment, whoever sends them.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_error_pages_update with site_id 4211, version 3, codes {"503":"app"}, note Show the shop's own holding page. (Change an environment's error pages.) Tell me what it returned.

Inputs

codesobject

404, 500, 502, 503, 504, each page or app.

Fields
404string
pageapp
500string
pageapp
502string
pageapp
503string
pageapp
504string
pageapp
notestring

Why, shown in the history. Up to 200 characters.

pagesobject

maintenance, 404, 500, 502, 503, 504, each {source?, message?}; source at most 64 KiB, message at most 300 characters, either null for the default.

Fields
404object
Fields
messagestring or null
sourcestring or null
500object
Fields
messagestring or null
sourcestring or null
502object
Fields
messagestring or null
sourcestring or null
503object
Fields
messagestring or null
sourcestring or null
504object
Fields
messagestring or null
sourcestring or null
maintenanceobject
Fields
messagestring or null
sourcestring or null
retryboolean

True applies the current pages again after rejected or unknown. Send it with version and nothing to change.

site_idintegerRequired

The environment row. At least 1.

support_emailstring or null

An email address. Up to 254 characters.

versionintegerRequired

The version from corestack_error_pages_get; a newer change makes it stale. At least 0.

Example call

tools/call
{
  "name": "corestack_error_pages_update",
  "arguments": {
    "site_id": 4211,
    "version": 3,
    "codes": {
      "503": "app"
    },
    "note": "Show the shop's own holding page"
  }
}

If it is refused

ReasonWhat to do
staleSomeone changed the pages since version was read. Read them again with corestack_error_pages_get.
error_pages_lockedCorefinity has locked this environment's error pages.
invalid_pageA page has an error the save cannot fix; nothing was saved. details.diagnostics lists each with its page, line and column.
overlap_nginx_rulesThe environment's nginx rules already set an error page for that code. Set the code to app, or remove the error_page line from the nginx rules first.
too_largeA page is over 64 KiB, or all pages together over 256 KiB.
runtime_lacks_capabilityThe environment gets error pages with its next platform update.
operation_in_progressA change is still being applied; try again when it ends.
switch_reconcile_failedThe Maintenance switch could not be brought in line first; nothing was changed. Try again.
managed_elsewhereAnother control panel manages this environment.
feature_offError pages are not available to you yet.
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT