Appearance
Errors and diagnostics
CQL refuses a query it cannot run and tells you why, naming the place in the text and what to do instead.
There is one shape of message, four bands of code, and a short list of the ones you will actually meet. After this page the full table is a lookup, not a read.
How one reads
CQL2004 · error · Column `from` is a reserved word; write it in backticks, qualify it as `t.from`,
or rename it with `by my_from = t.from` (line 4, column 9)Every diagnostic has four parts:
- a code that you can search this handbook for
- a severity
- a message in plain words
- a position that the editor underlines
Most messages end with the fix. When CQL can guess what you meant, it offers the correction in a hint underneath. Examples are a misspelled operator or a wrongly cased address.
In the workbench
The editor underlines each diagnostic where it is, and the Diagnostics tab lists them all.

Each row says where the diagnostic came from. "as you type" is the check your browser makes on every keystroke. "when checked" is the check against the chains the query reads, a moment after you pause. The tab comes forward on its own when a run is refused, and when the check against the chain finds a new error. A slip you make while you type does not move it: the squiggle shows you where.
Two notes are about the rows of a run, so only the run can find them: CQL3909 for logs that no selected event decodes, and CQL3911 for values that are null because their type is not the column's type. They are not in the Diagnostics tab. They are under the grid, after the row count.
Three severities
- error — the query does not run. Fix it and run again.
- warning — the query runs, but something in it is probably not what you meant.
CQL2901, for example: comparing an address with a bare0x…literal ignores the chain, and this query spans two. - info — a fact about the run that is worth knowing. For example, the range was sampled, or a value was rounded. These arrive with the rows, not instead of them.
Four bands
The first digit says when CQL found the problem.
| Band | Found | About |
|---|---|---|
CQL1xxx | as you type | the text: a missing semicolon, an odd hex digit, an invalid checksum |
CQL2xxx | as you type | meaning: unknown names, mismatched types, a function the ABI lacks |
CQL3xxx | before the run | the chain and the caps: a block beyond the head, a missing ABI, too many rows |
CQL4xxx | during the run | things only the data can reveal: a node that stopped answering, a timeout, a cap crossed |
The first two bands appear in the editor before you press Run. The third appears a moment later, after CQL looks at the chain. Only the fourth costs you a run.
The ones you will meet
CQL1016 · Unexpected …; expected …— a syntax slip, most often the missing;after aletor the missing|before a stage. The hint tells you where to put the|.CQL1006 · Address checksum is invalid— a mixed-case address with a typo. The hint gives the corrected spelling. You can also write the address all in lowercase. stETH's address is mixed-case, so paste it rather than retype it.CQL2002 · … is not a column, source alias or let binding— a name CQL does not know. Usually the alias is wrong (swhen the source saysas t).CQL2004 · Column … is a reserved word— you wrotefrombare. Qualify it (t.from), backtick it (`from`), or rename it (by sender = t.from).CQL2010 · Function … not found in the ABI— the ABI that CQL found for the contract has no such function. An example iss.stEthPerToken()on stETH, when that function belongs to wstETH. Open the Contract tab to see what it does have.CQL2050 · Expression needs a name—project { t.value * 2 }has no obvious column name. Write{ doubled: t.value * 2 }.CQL3001 · … is beyond the pinned head— a block number in the future.CQL3008 · … has no ABI— no registry has a verified ABI for the contract. Press check again on its row in the Diagnostics tab, in case it was verified since CQL last looked. Otherwise add the ABI to your library, or call the function by its signature with.call(). See Read a contract nobody has verified.CQL3009 · ABI resolution unavailable …— a registry did not answer for the contract, so CQL does not know its ABI. Run the query again after a short time. A registry can also refuse every request for a chain, or every request with heto's key. IfCQL3009stays, add the ABI to your library, or call the function by its signature with.call().CQL3014/CQL3016— the query is too large. Narrow, sample or summarize it. See Long ranges and limits.CQL3901 · No at given; using …— an event source with no range read the default window. It is for information only. Addatif you wanted a different window.CQL4006 · Run exceeded the … timeout— narrow the query or sample more coarsely.
When a run is refused for credits
Nothing is charged during the beta. After it, runs will cost credits, and the run bar will show roughly what a run costs before you press Run. If your balance does not cover a run, heto refuses it before anything happens:
CQL0402 · Insufficient credits: this run needs 1.084744 credits and the balance is 0.491119CQL0402 is not about the query, so it has no position in the text, and pressing Run again will not help. A link beside the message opens the usage page, with your balance and every charge.
See also
- Diagnostic codes — every code, one line each.
- Syntax — what the text is allowed to say.