cube-js/cube · error

Inconsistent dateRange configuration for the compare date ra

Error message

Inconsistent dateRange configuration for the compare date range query: {}

What it means

Raised in get_date_range_value when the compare date range query's time dimension does have a dateRange, but its value is malformed — for example an empty or single-element list instead of the expected [from, to] pair. The query plan cannot interpret the boundaries, so the transform aborts before contacting Cube Store.

Source

Thrown at rust/cube/cubeorchestrator/src/query_result_transform.rs:245

    time_dimensions: Option<&Vec<QueryTimeDimension>>,
) -> Result<DBResponsePrimitive> {
    let time_dimensions = match time_dimensions {
        Some(time_dimensions) => time_dimensions,
        None => bail!("QueryTimeDimension should be specified for the compare date range query."),
    };

    let dim = match time_dimensions.first() {
        Some(dim) => dim,
        None => bail!("No time dimension provided."),
    };

    let date_range: &Vec<String> = match &dim.date_range {
        Some(date_range) => date_range,
        None => bail!("Inconsistent QueryTimeDimension configuration: dateRange required."),
    };

    if date_range.len() == 1 {
        bail!(
            "Inconsistent dateRange configuration for the compare date range query: {}",
            date_range[0]
        );
    }

    Ok(DBResponsePrimitive::String(
        date_range.join(COMPARE_DATE_RANGE_SEPARATOR),
    ))
}

/// Parse blending query key from time dimension for query.
pub fn get_blending_query_key(time_dimensions: Option<&Vec<QueryTimeDimension>>) -> Result<String> {
    let dim = time_dimensions
        .and_then(|dims| dims.first().cloned())
        .context("QueryTimeDimension should be specified for the blending query.")?;

    let granularity = dim
        .granularity.clone()

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Provide dateRange as exactly two entries: the start and end of the range
  2. When using named ranges, make sure the range resolves to a bounded interval (unbounded ranges are not valid for compare queries)
  3. Check client-side query builders that assemble dateRange dynamically for off-by-one or empty array bugs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at rust/cube/cubeorchestrator/src/query_result_transform.rs:245 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/f7ef2367a86df9e4. Report an issue: GitHub.