-
Notifications
You must be signed in to change notification settings - Fork 159
Add Craft Cloud diagnostics guidance #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
fbd2d42
2189269
387c3e1
3042b3e
3aab863
92dfab9
468c3a5
73720dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| description: Diagnose failed requests to Craft Cloud. | ||
| pageClass: cloud-diagnostics | ||
| --- | ||
|
|
||
| # Diagnostics | ||
|
|
||
| ## Response Headers | ||
|
|
||
| - `cf-*`: Cloudflare | ||
| - `x-gateway-*`: Craft Cloud gateway | ||
| - All others: origin (Craft) | ||
|
|
||
| | Response Header | Description | | ||
| | --- | --- | | ||
| | `x-gateway-flow` | How Craft Cloud produced the response. For example, `/origin/fetch` reached Craft. | | ||
| | `x-gateway-http-signature` | [Request-signing](request-signing.md) result. `verified` succeeded; `unverified` was detected but failed validation. | | ||
| | `cf-ray` | Cloudflare request ID.<sup>1</sup> | | ||
| | `cf-cache-status` | Cloudflare [cache status](static-caching.md#troubleshooting).<sup>1</sup> | | ||
| | `x-gateway-cf-ray` | Cloudflare request ID.<sup>2</sup> | | ||
| | `x-gateway-cf-cache-status` | Cloudflare [cache status](static-caching.md#troubleshooting).<sup>2</sup> | | ||
|
|
||
| <sup>1</sup> With [Cloudflare O2O](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/how-it-works/) requests, the marked headers describe the customer zone. | ||
|
|
||
| <sup>2</sup> The marked headers describe the Craft Cloud zone and are only present with [Cloudflare O2O](https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/saas-customers/how-it-works/) requests. | ||
|
|
||
| ## Interpreting Failures | ||
|
|
||
| Status alone does not identify the response layer. Use it with the diagnostic | ||
| headers: | ||
|
|
||
| | Status | Response Headers | Interpretation | | ||
| | --- | --- | --- | | ||
| | `4xx/5xx` | `x-gateway-flow: /origin/fetch` | Returned by Craft; check application logs. | | ||
| | `400/403/413` | `x-gateway-flow: /origin/reject` | Detected invalid or malicious request. | | ||
| | `401` | `x-gateway-http-signature: unverified` | The signature was invalid or expired. | | ||
| | `404` | `x-gateway-flow: /` | Hostname did not match a Craft Cloud environment. | | ||
| | `429/503` | `Retry-After: 𝑛` | Automate retry, honoring `Retry-After`. | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For non-idempotent requests such as GraphQL mutations or form submissions, automatically retrying every Useful? React with 👍 / 👎. |
||
| | `500/502` | No `x-gateway-flow: /origin/fetch` | A gateway error occurred; contact support if it persists. | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a Useful? React with 👍 / 👎. |
||
| | `504` | `x-gateway-flow: /origin/fetch/error` | The origin exceeded the [request duration limit](quotas.md#requests-responses). | | ||
| | `5xx` | No `x-gateway-flow` | The error occurred before the gateway, either in the `craft.cloud` zone or a parent Cloudflare zone. | | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exhaustive attribution is incorrect for intermediary-generated standard headers. In particular, Craft Cloud's gateway and capacity-limiting paths can emit the unprefixed
Retry-Afterused later on this page, and Cloudflare or the gateway may also add or rewrite fields such asDate,Server, andContent-Length; readers could therefore misidentify the response layer. Restrict this statement to known origin headers instead of treating every non-cf-*/x-gateway-*header as origin data.Useful? React with 👍 / 👎.