Skip to content

Commit cfab706

Browse files
fridgecowTom Benn
andauthored
Expand GraphQL API error documentation with service unavailability, auth, and internal errors (#28446)
* DS-15448: expand GraphQL API error documentation with service unavailability, auth, and internal errors * DS-15448: address review comments, add error codes and link to token docs --------- Co-authored-by: Tom Benn <tbenn@cloudflare.com>
1 parent 86c98ec commit cfab706

1 file changed

Lines changed: 46 additions & 11 deletions

File tree

src/content/docs/analytics/graphql-api/errors.mdx

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,67 @@ All responses contain an `errors` array, which will be `null` if there are no er
3333

3434
## Common error types
3535

36+
### Service unavailability
37+
38+
Sample error messages:
39+
40+
* `unable to execute query, please try again later` (HTTP `503`)
41+
* `too many queries in progress, please try again later` (HTTP `503`)
42+
43+
These messages indicate a temporary server-side issue. The first message typically means the upstream database is unreachable or returned an error. The second message means the server has reached its maximum number of concurrent queries.
44+
45+
Retry the request after a short delay. If the error persists, check the [Cloudflare status page](https://www.cloudflarestatus.com/) for ongoing incidents.
46+
3647
### Dataset accessibility limits exceeded
3748

3849
Sample error messages:
3950

40-
* "cannot request data older than..."
41-
* "number of fields cannot be more than..."
42-
* "does not have access to the path..."
43-
* "not available for your plan. Upgrade to..."
51+
* `cannot request data older than...` (HTTP `400`)
52+
* `number of fields can't be more than...` (HTTP `400`)
53+
* `limit must be positive number and not greater than...` (HTTP `400`)
54+
* `query time range is too large...` (HTTP `400`)
4455

4556
These messages indicate that the query exceeds what is allowed for the particular dataset under the current [plan](https://www.cloudflare.com/plans/), and an upgrade should be considered. Refer to [Node limits](/analytics/graphql-api/limits/#node-limits-and-availability) for details.
4657

4758
### Parsing issues
4859

4960
Sample error messages:
5061

51-
* "error parsing args..."
52-
* "scalar fields must have not selections"
62+
* `error parsing args...` (HTTP `400`)
63+
* `scalar fields must have no selections` (HTTP `400`)
64+
* `object field must have selections` (HTTP `400`)
65+
* `unknown field...` (HTTP `400`)
66+
* `query contains error, please review it and retry` (HTTP `400`)
5367

54-
These messages indicate that the query cannot be processed because it is malformed.
68+
These messages indicate that the query cannot be processed because it is malformed. Check the query syntax against the [GraphQL schema](/analytics/graphql-api/getting-started/explore-graphql-schema/) and correct the invalid fields or structure.
5569

5670
### Rate limits exceeded
5771

5872
Sample error messages:
5973

60-
* "limit reached, please try reduced time period"
61-
* "quota exceeded, please repeat your request in the next minute"
62-
* "rate limiter budget depleted, try again after 5 minutes"
74+
* `rate limiter budget depleted, try again after 5 minutes` (HTTP `429`)
75+
* `in combination, your request queries too many nodes, zones and accounts` (HTTP `429`)
76+
* `query consumed excessive resources, please try running smaller queries which consume fewer resources` (HTTP `429`)
77+
78+
These messages indicate the query exceeded rate or resource limits. Reduce the query complexity, the number of zones or accounts per request, or wait before retrying. Refer to the [Limits](/analytics/graphql-api/limits/) section for more details about rate limits.
79+
80+
### Authentication and authorization errors
81+
82+
Sample error messages:
83+
84+
* `Unauthorized` (HTTP `401`)
85+
* `not authorized for that account` (HTTP `403`)
86+
* `zones [...] are not authorized` (HTTP `403`)
87+
* `does not have access to the path...` (HTTP `403`)
88+
89+
An `Unauthorized` response means the API token or bearer token is missing, expired, or invalid. Verify that you are passing a valid token in the `Authorization` header.
90+
91+
A `403` response means the token does not have the required permissions for the requested account or zone. Verify the token has the **Analytics: Read** permission for the relevant resources. Refer to the [Tokens](/fundamentals/api/get-started/create-token/) section for more details.
92+
93+
### Internal server errors
94+
95+
Sample error message:
96+
97+
* `Internal server error` (HTTP `500`)
6398

64-
Refer to the [Limits](/analytics/graphql-api/limits/) section for more details about rate limits.
99+
This is a generic error indicating an unexpected failure. If it persists, contact [Cloudflare Support](https://support.cloudflare.com/) with the full request and response, including the `Ray-ID` header from the HTTP response.

0 commit comments

Comments
 (0)