Error codes
An error body is {"error":"<message>","code":"<code>"}. The message is for people and can change. The code is stable. This page lists the ten codes that /api/query writes in the code field. Other errors carry only a message. The ClickHouse HTTP interface responds with the ClickHouse number in the second column when there is one. Where the column is empty, it takes the number from the HTTP status: 62 for 400, 516 for 401, 497 for 403, 60 for 404 and 999 for any other status. exists and replica_read_only are 409 responses, so they give 999.
| Code | ClickHouse number | Description |
|---|---|---|
exists | A table, view, index, rollup, dictionary, rule or policy of this name already exists. | |
replica_read_only | The node is a replication replica and refuses client writes and DDL. | |
not_found | The named object does not exist. | |
access_denied | A policy denies the caller the table or database that a write targets. | |
result_row_cap_exceeded | 396 | The result has more rows than max_query_rows and result_overflow_mode is throw. |
illegal_aggregation | 184 | An aggregate function stands where none may stand: inside another aggregate, or in WHERE or GROUP BY. |
unknown_function | 46 | The query calls a function that does not exist. |
cyclic_aliases | 174 | SELECT aliases are defined through each other. |
illegal_type_of_filter | 59 | A WHERE, HAVING or -If condition is one value of a type with no truth value, such as text, Decimal, Date or an array. |
decimal_scale_out_of_bounds | 69 | The scales of multiplied or divided decimals add up past the width of the result type. |