influxdata/influxdb · error · Error
Cannot parse the timestamp
Error message
Cannot parse the timestamp: {0} What it means
This error is the `ParsingTimestamp(#[from] chrono::ParseError)` variant of the HTTP server's `Error` enum in influxdb3_server/src/http.rs, rendered as "Cannot parse the timestamp: {0}". It is thrown when an RFC3339/ISO-8601 timestamp supplied in an HTTP request cannot be parsed by `chrono::DateTime::parse_from_rfc3339` (converted via `#[from]`). The chrono parse error is embedded directly as the message payload.
Solutions
- Format the timestamp as full RFC3339 with timezone offset, e.g. `2024-09-19T12:00:00Z`
- If you have an epoch integer, convert it to RFC3339 before sending (or use the API's epoch-accepting parameter if available)
- Inspect the embedded chrono::ParseError message to identify the malformed component
- Ensure the timestamp includes fractional seconds in the supported `YYYY-MM-DDTHH:MM:SS[.fff]Z` form
Example fix
// before
{"start_timestamp": "2024-09-19T12:00:00"} // missing offset
// after
{"start_timestamp": "2024-09-19T12:00:00Z"} Defensive patterns
Strategy: validation
Validate before calling
// normalize to RFC3339 before sending
function toRfc3339(input) {
const d = typeof input === 'number' ? new Date(input * (input < 1e12 ? 1000 : 1)) : new Date(input);
const ts = d.toISOString(); // always RFC3339 with Z
if (isNaN(d.getTime())) throw new Error(`not a valid date: ${input}`);
return ts;
} Type guard
function isRfc3339(s) {
return typeof s === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/.test(s);
} Try / catch
try {
await query(db, sql, { start_timestamp: ts });
} catch (e) {
if (e.message.startsWith('Cannot parse the timestamp')) {
throw new Error(`Timestamp '${ts}' must be RFC3339 with offset, e.g. 2024-09-19T12:00:00Z`, { cause: e });
}
throw e;
} Prevention
- Always serialize dates with toISOString() or equivalent RFC3339 serializers
- Never pass raw epoch integers to timestamp parameters
- Ensure timezone-aware datetimes (include Z or offset)
- Unit-test your timestamp serialization against a strict RFC3339 regex
When it happens
Trigger: Supplying a `timestamp`, start/stop time, or other absolute-time HTTP parameter in a format chrono cannot parse as RFC3339 — e.g. missing timezone offset, unix epoch integer, or loose ISO-8601 variants.
Common situations: Sending a Unix epoch number (`1726800000`) where RFC3339 is required; omitting the `Z`/`+00:00` offset (`2024-09-19T12:00:00`); passing a datetime from a client library serialized in a non-RFC3339 format (e.g. Python `isoformat()` without tzinfo, JS `toISOString` is fine but `Date.toString()` is not).
Related errors
- Timestamp is out of range
- Cannot parse the given human time
- {error_code}
- failed to build an http client
- failed to parse JSON response
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/b1dd930ff7e0ebfc.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_server/src/http.rs:382
#[error(transparent)]
Influxdb3TypesHttp(#[from] influxdb3_types::http::Error),
#[error("Authorization error: {0}")]
ResourceAuthorization(#[from] ResourceAuthorizationError),
#[error("Authentication error: {0}")]
Authentication(#[from] AuthenticatorError),
#[error("The following Database does not exist: {0}")]
MissingDb(String),
#[error("The following Database Table does not exist: {0}")]
MissingTable(String),
#[error("Cannot parse the given human time: {0}")]
ParsingHumanTime(#[source] humantime::DurationError),
#[error("Cannot parse the timestamp: {0}")]
ParsingTimestamp(#[from] chrono::ParseError),
#[error("Timestamp is out of range")]
TimestampOutOfRange,
#[error("Current node mode does not use the processing engine")]
NoProcessingEngine,
#[error("invalid request: {0}")]
InvalidRequest(String),
#[error(transparent)]
LegacyWriteParse(#[from] WriteParseError),
}
#[derive(Debug, Error)]
pub(crate) enum AuthenticationError {
#[error("the request was not authenticated")]View on GitHub (pinned to 06200ef96b)