Invalid Date reaches metadata rollup queries as "nan" Int64 param (BAD_QUERY_PARAMETER 457)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Description
Symptom
Occasional BAD_QUERY_PARAMETER (code 457) failures on the key-rollup discovery query, observed in a production tenant's query_log (found while investigating ClickHouse/support-escalation#8482):
Code: 457. DB::Exception: Value nan cannot be parsed as Int64 for query parameter 'HYPERDX_PARAM_78043'
because it isn't parsed completely: only 0 of 3 bytes was parsed: . (BAD_QUERY_PARAMETER)
SELECT Key FROM {db:Identifier}.{table:Identifier}
WHERE ColumnIdentifier = {col:String}
AND Timestamp >= toStartOfFifteenMinutes(fromUnixTimestamp64Milli({HYPERDX_PARAM_78043:Int64})) ...
The literal string nan is bound as an Int64 date param — i.e. Date.getTime() returned NaN, meaning an Invalid Date reached getAlignedDateRange / the rollup query builders in packages/common-utils/src/core/metadata.ts (getMapKeys, getMetadataMVKeyValues).
Observed repeatedly (e.g. 2026-08-13 22:28/22:30/23:31, 2026-08-16 23:58 UTC on one tenant), always in pairs, always the same param-name hash (78043 = hash of nan).
Expected
An invalid/unparseable date range should never produce a ClickHouse query with nan params. Either:
- Guard the metadata query paths: skip (or throw a descriptive client-side error) when
dateRangecontains an Invalid Date, and/or - Find and fix the upstream producer of the Invalid Date (likely a date-range parse from URL/live-tail state in the app).
Notes
- Low severity: the failure is caught and the affected facet fetch falls back / returns empty, but it burns a query, logs a confusing server-side error, and can mask real issues.
- Repro likely involves an invalid
from/toURL param or a transient live-tail state on the search page.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/common-utils/src/core/metadata.ts at getMapKeys and getMetadataMVKeyValues, then trace how getAlignedDateRange receives dates from the search page's URL or live-tail state. Reproduce an invalid from/to range and verify the metadata query paths no longer bind nan as an Int64 parameter, either by guarding the range or fixing the upstream producer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100