{"record":{"id":"8a73f91a82ce50f5","repo":"influxdata/influxdb","slug":"timestamp-is-out-of-range","errorCode":null,"errorMessage":"Timestamp is out of range","messagePattern":"Timestamp is out of range","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":385,"sourceCode":"    #[error(\"Authorization error: {0}\")]\n    ResourceAuthorization(#[from] ResourceAuthorizationError),\n\n    #[error(\"Authentication error: {0}\")]\n    Authentication(#[from] AuthenticatorError),\n\n    #[error(\"The following Database does not exist: {0}\")]\n    MissingDb(String),\n\n    #[error(\"The following Database Table does not exist: {0}\")]\n    MissingTable(String),\n\n    #[error(\"Cannot parse the given human time: {0}\")]\n    ParsingHumanTime(#[source] humantime::DurationError),\n\n    #[error(\"Cannot parse the timestamp: {0}\")]\n    ParsingTimestamp(#[from] chrono::ParseError),\n\n    #[error(\"Timestamp is out of range\")]\n    TimestampOutOfRange,\n\n    #[error(\"Current node mode does not use the processing engine\")]\n    NoProcessingEngine,\n\n    #[error(\"invalid request: {0}\")]\n    InvalidRequest(String),\n\n    #[error(transparent)]\n    LegacyWriteParse(#[from] WriteParseError),\n}\n\n#[derive(Debug, Error)]\npub(crate) enum AuthenticationError {\n    #[error(\"the request was not authenticated\")]\n    Unauthenticated,\n    #[error(\n        \"Authorization header was malformed, the request was not in the form of 'Authorization: <auth-scheme> <token>', supported auth-schemes are Bearer, Token and Basic\"","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L367-L403","documentation":"This error is the `TimestampOutOfRange` unit variant of the HTTP server's `Error` enum in influxdb3_server/src/http.rs, rendered as \"Timestamp is out of range\". It is thrown when a parsed timestamp is valid RFC3339 but falls outside the range the server accepts (e.g. outside the representable nanosecond range of i64 for the query planner, or before/after bounds the query window allows).","triggerScenarios":"Requesting a query time range with a start/stop timestamp far outside supported bounds — e.g. year 0001, year 9999, or epochs that overflow nanosecond i64 conversion — via the HTTP query API.","commonSituations":"Using `0001-01-01T00:00:00Z` / `9999-12-31...` as sentinel 'beginning of time' bounds; converting millisecond or second epochs incorrectly into nanoseconds and overflowing; time-range variables populated with extreme default values.","solutions":["Constrain start/stop timestamps to realistic dates that fit nanosecond i64 (~1677-09-21 to 2262-04-11, the chrono nanosecond range)","Convert epochs with the correct unit (seconds vs ms vs ns) before sending","Clamp 'all time' queries to supported bounds or omit the time-range parameters entirely","Check the API docs for the exact accepted timestamp range for the parameter"],"exampleFix":"// before\n{\"start_timestamp\": \"0001-01-01T00:00:00Z\", \"stop_timestamp\": \"9999-12-31T23:59:59Z\"}\n// after\n{\"start_timestamp\": \"1970-01-01T00:00:00Z\", \"stop_timestamp\": \"2262-04-11T23:47:16Z\"}","handlingStrategy":"validation","validationCode":"// clamp timestamps to the representable chrono nanosecond range before sending\nconst MIN = Date.parse('1677-09-21T00:12:44Z');\nconst MAX = Date.parse('2262-04-11T23:47:16Z');\nfunction clampTimestamp(iso) {\n  const t = Date.parse(iso);\n  if (t < MIN || t > MAX) throw new Error(`timestamp ${iso} outside supported range`);\n  return new Date(Math.min(Math.max(t, MIN), MAX)).toISOString();\n}","typeGuard":"function inSupportedRange(iso) {\n  const t = Date.parse(iso);\n  return !isNaN(t) && t >= Date.parse('1677-09-21T00:12:44Z') && t <= Date.parse('2262-04-11T23:47:16Z');\n}","tryCatchPattern":"try {\n  await query(db, sql, { start_timestamp: start, stop_timestamp: stop });\n} catch (e) {\n  if (e.message === 'Timestamp is out of range') {\n    return query(db, sql, { start_timestamp: clampTimestamp(start), stop_timestamp: clampTimestamp(stop) });\n  }\n  throw e;\n}","preventionTips":["Avoid 0001/9999 sentinel dates for 'all time' — omit time bounds instead","Convert epoch units (s/ms/ns) carefully to avoid nanosecond overflow","Define app-level min/max time constants matching the server's supported range","Validate time-range variables in dashboards/reports that allow free input"],"tags":["http","timestamp","influxdb3","time-parsing","range"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}