err:user:bad_request:invalid_analytics_queryanalytics.getVerifications, analytics.getRatelimits, analytics.getGatewayRequests, or analytics.getRuntimeLogs). You get HTTP 400, and detail says what’s wrong.
Example response
Likely causes
- More than one statement, separated by
;, or no statement at all. SELECT *, or a column that isn’t exposed. The message says the column isn’t available.- A
SETTINGSclause, often pasted from a console session, such asSETTINGS max_threads = 4. - A syntax error, or no
FROMclause. - An
INthat reads from a table, such asIN (SELECT ... FROM table). - The query is too big: more than 64 selected columns, more than 16 KiB of text, or more than 2000 syntax tree nodes (
Analytics query is too complex). - The query failed while running, for example on an unknown column (
Unknown identifier), a type mismatch, or a division by zero.
SELECT each have their own error.
How to fix
- Send exactly one
SELECTwith aFROM, using only the documented columns of the analytics tables. - Remove
SETTINGS. - Replace an
IN (SELECT ... FROM table)with a literal list or a CTE. - For
Unknown identifier, check the spelling and any CTE aliases. - Keep the query under 16 KiB and 64 output columns.
Related errors
err:user:bad_request:invalid_analytics_table: the query names a table that isn’t exposed.err:user:bad_request:invalid_analytics_function: the query calls a function outside the allowlist.err:user:bad_request:invalid_analytics_query_type: the statement isn’t aSELECT.err:user:bad_request:query_range_exceeds_retention: the time filter reaches past the workspace’s retention window.