quickwit-oss/quickwit · error

failed to parse --{}-date option parameter `{}`. supported f

Error message

failed to parse --{}-date option parameter `{}`. supported format is `YYYY-MM-DD[ HH:DD[:SS]]`

What it means

`quickwit split list` accepts `--start-date`/`--end-date` (option_name interpolated) filters parsed with a small set of fixed `time` crate format descriptions: `YYYY-MM-DD`, `YYYY-MM-DD HH:DD`, or `YYYY-MM-DD HH:DD:SS`, interpreted as UTC. A value that does not parse under any of these formats bails with this error naming the offending option and string.

Source

Thrown at quickwit/quickwit-cli/src/split.rs:438

fn parse_date(date_arg: &str, option_name: &str) -> anyhow::Result<OffsetDateTime> {
    let description = format_description::parse_borrowed::<2>("[year]-[month]-[day]")?;
    if let Ok(date) = Date::parse(date_arg, &description) {
        return Ok(date.with_hms(0, 0, 0)?.assume_utc());
    }

    for datetime_format in [
        "[year]-[month]-[day] [hour]:[minute]",
        "[year]-[month]-[day] [hour]:[minute]:[second]",
        "[year]-[month]-[day]T[hour]:[minute]",
        "[year]-[month]-[day]T[hour]:[minute]:[second]",
    ] {
        let description = format_description::parse_borrowed::<2>(datetime_format)?;
        if let Ok(datetime) = PrimitiveDateTime::parse(date_arg, &description) {
            return Ok(datetime.assume_utc());
        }
    }
    bail!(
        "failed to parse --{}-date option parameter `{}`. supported format is `YYYY-MM-DD[ \
         HH:DD[:SS]]`",
        option_name,
        date_arg
    );
}

fn parse_split_state(split_state_arg: &str) -> anyhow::Result<SplitState> {
    let split_state = match split_state_arg.to_lowercase().as_str() {
        "staged" => SplitState::Staged,
        "published" => SplitState::Published,
        "marked" => SplitState::MarkedForDeletion,
        _ => bail!(format!(
            "unknown split state `{split_state_arg}`. possible values are `staged`, `published`, \
             and `marked`"
        )),
    };
    Ok(split_state)

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Rewrite the value as `YYYY-MM-DD`, e.g. `--start-date 2024-01-01`.
  2. If a time is needed, use `YYYY-MM-DD HH:DD` or `YYYY-MM-DD HH:DD:SS` with a space separator, e.g. `--end-date "2024-01-01 10:30:00"`.
  3. Drop timezone suffixes (`Z`, `+00:00`) and `T` separators; values are assumed UTC.
  4. Convert epoch timestamps to UTC wall-clock form before passing them.

Example fix

// before
quickwit split list --index my-index --start-date 2024-01-01T00:00:00Z
// after
quickwit split list --index my-index --start-date "2024-01-01 00:00:00"
Defensive patterns

Strategy: validation

Validate before calling

const DATE_RE = /^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}(:\d{2})?)?$/;
function validateSplitListDate(value: string): string | null {
  return DATE_RE.test(value) ? null : `use YYYY-MM-DD[ HH:DD[:SS]], got: ${value}`;
}

Type guard

function isQuickwitDate(v: string): boolean {
  return /^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}(:\d{2})?)?$/.test(v);
}

Try / catch

// Match the parse failure and normalize to the accepted format before retrying
const res = await run(cmd);
if (res.code === 1 && /failed to parse --.*-date option/.test(res.stderr)) {
  const normalized = rawDate.replace("T", " ").replace(/(Z|[+-]\d{2}:?\d{2})$/, "").slice(0, 19);
  return run(cmd.replace(rawDate, normalized));
}

Prevention

When it happens

Trigger: Passing a date that is ISO-8601-with-T (`2024-01-01T10:00:00`), includes timezone offsets (`2024-01-01T10:00:00Z`), epoch millis (`1704067200`), or slash-formatted dates (`01/01/2024`) to `--start-date` or `--end-date` on `quickwit split list`.

Common situations: Copy-pasting RFC3339/ISO timestamps from logs or APIs (with `T` and `Z`) into the CLI; using Unix epoch values from monitoring dashboards; locale-formatted dates; forgetting that the separator must be a space, not `T`.

Understand the failure class

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/b5c1f69773fc2d9f. Report an issue: GitHub.