{"record":{"id":"4865554154f07650","repo":"influxdata/influxdb","slug":"cannot-parse-the-given-human-time-0","errorCode":null,"errorMessage":"Cannot parse the given human time: {0}","messagePattern":"Cannot parse the given human time: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":379,"sourceCode":"    #[error(\"Processing engine error: {0}\")]\n    ProcessingEngine(#[from] influxdb3_processing_engine::manager::ProcessingEngineError),\n\n    #[error(transparent)]\n    Influxdb3TypesHttp(#[from] influxdb3_types::http::Error),\n\n    #[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","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L361-L397","documentation":"This error is the `ParsingHumanTime(#[source] humantime::DurationError)` variant of the HTTP server's `Error` enum in influxdb3_server/src/http.rs, rendered as \"Cannot parse the given human time: {0}\". It is thrown when a human-readable duration supplied via HTTP query parameters (e.g. relative time ranges like `now()-30m` window or lookback parameters) cannot be parsed by the `humantime` crate. The original humantime::DurationError is attached as the source.","triggerScenarios":"Passing a malformed human-duration string in an HTTP API parameter that the server parses with `humantime::parse_duration` (e.g. relative time/window/retention-style parameters in query requests).","commonSituations":"Writing `30mins` or `1.5h` or `30 m` instead of humantime-accepted forms like `30m`, `1h 30m`; pasting a timestamp where a duration is expected (or vice versa); locale-formatted durations; trailing whitespace or units humantime does not accept (e.g. `wk`, `mo`).","solutions":["Use humantime-accepted syntax: combinations of seconds/minutes/hours/days, e.g. `30s`, `15m`, `2h`, `1d 4h`","Read the `source` (humantime::DurationError) message to see the exact offending character/position","Check the docs for the specific parameter — if it expects a timestamp not a duration, use RFC3339 instead","Trim whitespace/quotes from the parameter value"],"exampleFix":"// before\ncurl -X POST 'http://localhost:8181/api/v3/query_sql' -d '{\"db\": \"weather\", \"q\": \"SELECT * FROM temps\", \"start\": \"last 30 mins\"}'\n// after\ncurl -X POST 'http://localhost:8181/api/v3/query_sql' -d '{\"db\": \"weather\", \"q\": \"SELECT * FROM temps\", \"start\": \"30m\"}'","handlingStrategy":"validation","validationCode":"// validate human duration before sending\nconst HUMAN_RE = /^(\\s*\\d+\\s*(ns|us|ms|sec|secs|second|seconds|minutes|min|mins|m|hours|hour|hr|hrs|h|days|day|d|weeks|week|w)\\s*)+$/i;\nif (!HUMAN_RE.test(durationStr)) {\n  throw new Error(`invalid human duration: ${durationStr} (use e.g. 30m, 2h 15m)`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await query(db, sql, { start: durationStr });\n} catch (e) {\n  if (e.message.startsWith('Cannot parse the given human time')) {\n    throw new Error(`Bad duration '${durationStr}': use humantime syntax like 30m, 1h 30m`, { cause: e });\n  }\n  throw e;\n}","preventionTips":["Stick to humantime-accepted units (s, m, h, d, w) and plain digit counts","Build durations programmatically instead of string concatenation","Read the chained humantime source error for the exact bad character","Distinguish duration parameters from timestamp parameters in your client wrapper"],"tags":["http","time-parsing","influxdb3","humantime","invalid-argument"],"backgroundTag":"invalid-duration-format","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"}