corestack_ varnish_ vcl_ validate
Check custom Varnish VCL.
When to use it
Check custom Varnish VCL without saving it: the same checks a save runs. First the policy (corestack_varnish_policy_get), then a compile of the platform VCL with your hooks inserted, on the row's Varnish version (or on varnish_version, to check before a version change). Run it before every corestack_varnish_vcl_update.
The answer is {valid, diagnostics, test}. Each diagnostic has the hook, the line and column in that hook, severity (error or warning), kind (policy, compile or advice), a code for policy findings (VN-POL-nn, VN-WARN-nn, VN-LIM-nn) and the message. Warnings never block a save. The compile runs in a sandbox and can take up to a minute; when it cannot run, test says so and the policy findings still answer (a save then compiles again before Varnish loads the VCL).
Ask for it
Using the Corefinity MCP server, call corestack_varnish_vcl_validate with site_id 4211, hooks {"recv":"if (req.url ~ \"^/stockcheck/\") {\n return (pass);\n}\n"}. (Check custom Varnish VCL.) Tell me what it returned.Inputs
recv, backend_response, deliver, each text or null for empty. A hook left out is checked as it is now.
Fields
Up to 49,152 characters.
Up to 49,152 characters.
Up to 49,152 characters.
The row, a Magento 2 site or one of its environments. At least 1.
Compile on another offered version, such as 8.0, instead of the row's own.
Example call
{
"name": "corestack_varnish_vcl_validate",
"arguments": {
"site_id": 4211,
"hooks": {
"recv": "if (req.url ~ \"^/stockcheck/\") {\n return (pass);\n}\n"
}
}
}If it is refused
| Reason | What to do |
|---|---|
varnish_not_offered | The row is not a Magento 2 site. |
invalid_arguments | A malformed input, or a varnish_version that is not offered. |
managed_elsewhere | Another 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. |
tenant_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The 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_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |