Error handling#
Errors#
Error |
|
HTTP |
Meaning |
|---|---|---|---|
|
|
400 |
The query was rejected, for example for bad syntax, an unknown table or column, a disallowed function, or a missing |
|
|
400 |
The result exceeded the 1 GB result size limit. Add a |
|
|
400 |
The query timed out before completing. Add time bounds, channel filters, or tag filters to reduce the data scanned. |
|
|
400 |
Export was called on a query that reads only the system tables provided for Postgres clients, such as |
|
|
401 |
The request could not be authenticated. A missing or invalid API key returns a 401 without this error in the body. |
|
|
403 |
You don’t have view access to the workspace named in |
|
|
404 |
One or more requested datasets don’t exist in the given workspace, or you can’t read them. |
|
|
404 |
No data was found for one or more of the referenced datasets. |
|
429 |
The query exceeded a resource limit: the organization’s request rate, a memory limit, or the service’s capacity at that moment. |
|
|
|
500 |
An unexpected internal error occurred during execution. |
|
|
500 |
The query spans more datasets than can be planned at once. Add a |
|
|
500 |
The query was cancelled before it completed. |
|
|
500 |
Export is not configured for this deployment. |
Requests made with the same API key are also throttled before they reach the SQL service. Going over returns 429 with a plain-text body and a Retry-After header.
Request validation happens first#
A field that violates its constraints is rejected before the query reaches the planner: a missing workspace_rid, a query over 100,000 characters, or parquet_options on a CSV export. Those failures carry INVALID_ARGUMENT with the name ValidationNominalIo:ConstraintViolation and an empty parameters map.
That is a different failure from SQL_ERROR_INVALID_QUERY, which means your SQL was parsed and then rejected. The distinction tells you where to look: the request body, or the query text.
Error response schema#
Most errors serialize as a JSON object with the code, a name identifying what failed, a correlation id, and a parameters map. Querying a column that doesn’t exist returns:
{
"errorCode": "INVALID_ARGUMENT",
"errorName": "NominalSqlV1:SqlErrorInvalidQuery",
"errorInstanceId": "942263b0-a664-4f4b-a249-066b02f20371",
"parameters": {
"detail": "From line 1, column 8 to line 1, column 11: Column 'nope' not found in any table",
"sqlQueryId": "84d7919a-dae5-499f-a938-0d0bcf25c81b"
}
}
Three details are worth knowing when you’re debugging:
Read
parameters.detailfirst. On validation failures it carries the specific reason, with line and column positions into your query.errorNameonly tells you the category.errorNametells you which layer rejected the request.NominalSqlV1:SqlErrorInvalidQueryand its siblings come from the SQL layer, and carry asqlQueryIdyou can quote in a bug report. A bareDefault:InvalidArgumentwith an emptyparametersmap means the request body never parsed at all.RESOURCE_EXHAUSTEDis shaped differently. It returns HTTP 429 with a body containing onlyparameters, and noerrorCodeorerrorName, because there is no equivalent code in the serialization format the other errors use. Don’t parse it the same way.
Next steps#
Query: run a bounded query.
Writing queries: query patterns and examples.