CorefinityCorefinityDocs
Open the Control PanelControl Panel
Sites · 10 of 23

corestack_site_attach_domain

Attach a domain.

Scope writeAsks you to confirmRuns as a taskNo secrets returnedCoreCluster
On this page

When to use it

Attach hosts to a site or environment and make it serve them: claims the hosts, issues the certificate, switches the row to its live address and rewrites its database from the preview host to the canonical one.

Behind Cloudflare: when corestack_site_attach_domain_check lists a host in proxied_unconfirmed, Cloudflare proxies it in a zone the Control Panel cannot look behind, so the check cannot see the address behind the proxy. Each such host needs proof that the person controls it: a TXT record named verification.name holding verification.value (the value is their company's), added in Cloudflare. Ask the person to add it if verification.found is false, to check in Cloudflare that the host's record points at the address the check names (expected_ip), and send proxied_records_checked: true only once they have done both. The attach reads the TXT record again itself. Without the flag the attach answers invalid_arguments on proxied_records_checked and nothing is changed. A host whose confirmable is false is refused on hosts whatever you send: with its challenge_path.note when the certificate path blocks it (the change to make in Cloudflare, for example setting SSL/TLS to Full), otherwise with the TXT record to add (or why it could not be read). Make that change, check again, then attach. The operation's notes then say the record was confirmed rather than checked.

On a staging or development environment the attach never switches outgoing mail on: a Magento 2 copy's mail hold (system/smtp/disable) stays as it is, and the operation records it as held for the row's role. Only a production row's attach releases mail (on a pending_dns attach, at the cutover). The last step flushes the row's Redis; a row with no Redis records the flush as skipped and the attach still completes.

After the store change completes and before changing DNS:

Request / with corestack_site_smoke_test, setting host to the store domain. The final URL must be on that store's base_url host from corestack_site_magento_stores_list (the domain itself, or its bare or www form when the base URL uses it), and the title must be that store's. Magento redirects to the store's base URL; a redirect to any other host means its base URL points elsewhere. GraphQL picks its store from the Store header, so it cannot prove a domain's store.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_site_attach_domain with site_id 4211, hosts ["example.co.uk","guns.example.co.uk","www.guns.example.co.uk"], canonical example.co.uk, aliases [{"host":"guns.example.co.uk","serve":"storefront","store":{"code":"guns","type":"website"},"base_url":true},{"host":"www.guns.example.co.uk","serve":"storefront","store":{"code":"guns","type":"website"}}], default_store {"code":"base","type":"website"}. (Attach a domain.) Tell me what it returned.

Inputs

aliasesarray of objects

How non-canonical hosts are served on Shopware and Magento 2. Up to 9 items.

host: One of hosts, other than canonical, listed once. store: {code, type} where type is website or store; required for storefront. base_url: Choose this address for the store's base URLs; at most one per store.

Fields of each item
base_urlboolean
hoststringRequired

Up to 253 characters.

servestringRequired
redirectstorefront
storeobject
Fields
codestringRequired

Up to 32 characters.

typestringRequired
websitestore
canonicalstringRequired

The host the row is served on; one of hosts. Up to 253 characters.

confirm_domainstringRequiredConfirmation

The site's domain on the production row; the canonical host on any other row. Up to 253 characters.

confirm_replacementsboolean

Allow the DNS plan to replace existing records.

default_storeobject or null

{code, type} for the default store, or null for Magento's default.

Fields
codestringRequired

Up to 32 characters.

typestringRequired
websitestore
hostsarray of stringsRequired

The hosts to attach (production row: the site's domain or its www form among them; any other row: never it). A host-migration copy made under its provider's platform host may leave that name out (it can never point here). Up to 10 items.

pending_dnsboolean

Attach before DNS points at the platform (a migration's test of the copy): crons and outgoing mail stay held until the cutover. Each host that does not point here yet needs its TXT proof of control; a refusal names the record and its value. Not with point_dns.

point_dnsboolean

Write the DNS plan through your company's Cloudflare connection.

proxied_records_checkedboolean

The person has checked in Cloudflare that every host corestack_site_attach_domain_check lists in proxied_unconfirmed points at the platform's address. Ask them; never set it for them.

site_idintegerRequired

At least 1.

wwwstring

Which form the other redirects to; default from canonical.

wwwbare

Your assistant fills in a confirmation only after you agree.

Example call

tools/call
{
  "name": "corestack_site_attach_domain",
  "arguments": {
    "site_id": 4211,
    "hosts": [
      "example.co.uk",
      "guns.example.co.uk",
      "www.guns.example.co.uk"
    ],
    "canonical": "example.co.uk",
    "confirm_domain": "example.co.uk",
    "aliases": [
      {
        "host": "guns.example.co.uk",
        "serve": "storefront",
        "store": {
          "code": "guns",
          "type": "website"
        },
        "base_url": true
      },
      {
        "host": "www.guns.example.co.uk",
        "serve": "storefront",
        "store": {
          "code": "guns",
          "type": "website"
        }
      }
    ],
    "default_store": {
      "code": "base",
      "type": "website"
    }
  }
}

If it is refused

ReasonWhat to do
confirm_mismatchA typed confirmation does not match (confirm_domain: the site's domain on production, the canonical host elsewhere; confirm_name: the cluster's or environment's name); ask the person for the exact value.
provisioningThe site is still being created; wait for corestack_site_provisioning_get to finish.
already_attachedThe row already serves its domain; change hosts with corestack_domains_update instead.
platform_plugins_offA WordPress production site whose platform plugins are turned off cannot go live, because they send the site's email from its verified address. Nothing was changed. Ask the person, turn them back on with corestack_site_platform_plugins_set (enabled: true, always allowed), follow the task it answers until it completes (the attach answers busy meanwhile), then attach again. corestack_site_attach_domain_check lists this in blockers first.
platform_plugins_applyingThe site's platform plugins are back on, but the platform has not finished applying that, so it cannot go live yet. Nothing was changed. Try again in a minute. If it stays, the last change failed: turn them on again with corestack_site_platform_plugins_set (enabled: true), which starts a new operation and answers its task, follow it until it completes, then attach again. corestack_site_attach_domain_check lists this in blockers too.
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
invalid_argumentsOn hosts ("<install>.wpengine.com is WP Engine's own address, which can never point here: attach the site's own domains."): a host under a migration provider's own platform domain (*.wpengine.com, *.wpenginepowered.com, *.cloudwaysapps.com); the site's own domain is the one exception. Nothing is written.
store_hostsThe site has platform store addresses managed by staff; contact support.
store_requiredaliases.<n>.store identifies the missing choice. Choose a Magento website or store view for every serving alias.
store_unknownaliases.<n>.store or default_store identifies the choice. Read the stores again and choose a code Magento lists.
store_inactivealiases.<n>.store or default_store identifies the choice. Switch the store view on in Magento or choose another.
store_code_formataliases.<n>.store or default_store identifies the choice. Use a Magento code with lower-case letters, digits or underscores, up to 32 characters.
store_host_not_servedFirst add the address as an alias that shows its own store.
store_mapping_foreignThe store rules are managed outside the Control Panel; contact support.
store_mapping_unreadableThe existing store rules cannot be read safely; contact support.
nginx_rules_not_adoptedThe site's rules are not ready for this change; contact support.
nginx_rules_lockedThe site's rules are locked; contact support.
nginx_invalidThe site's existing rules need attention before the store can be changed.
upstream_unavailableMagento's stores could not be read; try again in a moment.
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.

Store-choice refusals name aliases.<n>.store, where n is the alias's zero-based position, or aliases when its host cannot be matched. Default-store refusals name default_store.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT