risingwavelabs/risingwave · error
value {:?} out of range, expect {:?}
Error message
value {:?} out of range, expect {:?} What it means
create_database validates db.barrier_interval_ms via OverrideValidate::barrier_interval_ms before inserting the catalog row. The check (expect_range, src/common/src/system_param/mod.rs:281) rejects values outside the allowed range for the barrier interval, returning this error string wrapped in anyhow. This prevents creating a database whose parameter cannot be represented (i32) or is semantically invalid.
Source
Thrown at src/meta/src/controller/catalog/create_op.rs:93
owner_id: Set(owner_id),
schema_id: Set(schema_id),
database_id: Set(database_id),
belong_to_oid: Set(belong_to_oid),
initialized_at: Default::default(),
created_at: Default::default(),
initialized_at_cluster_version: Set(Some(current_cluster_version())),
created_at_cluster_version: Set(Some(current_cluster_version())),
};
Ok(active_db.insert(txn).await?)
}
pub async fn create_database(
&self,
db: PbDatabase,
) -> MetaResult<(NotificationVersion, risingwave_meta_model::database::Model)> {
// validate first
if let Some(ref interval) = db.barrier_interval_ms {
OverrideValidate::barrier_interval_ms(interval).map_err(|e| anyhow::anyhow!(e))?;
}
if let Some(ref frequency) = db.checkpoint_frequency {
OverrideValidate::checkpoint_frequency(frequency).map_err(|e| anyhow::anyhow!(e))?;
}
let inner = self.inner.write().await;
let owner_id = db.owner as _;
let txn = inner.db.begin().await?;
ensure_user_id(owner_id, &txn).await?;
check_database_name_duplicate(&db.name, &txn).await?;
let db_obj = Self::create_object(&txn, ObjectType::Database, owner_id, None).await?;
let mut db: database::ActiveModel = db.into();
db.database_id = Set(db_obj.oid.as_database_id());
let db = db.insert(&txn).await?;
let mut schemas = vec![];
for schema_name in iter::once(DEFAULT_SCHEMA_NAME).chain(SYSTEM_SCHEMAS) {View on GitHub (pinned to 6469eb736d)
Solutions
- Retry CREATE DATABASE with a barrier_interval_ms inside the accepted range.
- Verify the unit is milliseconds and the value fits i32.
- Drop the barrier_interval_ms field to use the cluster default.
Example fix
// before db.barrier_interval_ms = Some(10_000_000_000); // out of range // after db.barrier_interval_ms = Some(250);
Defensive patterns
Strategy: validation
Validate before calling
// validate before CREATE DATABASE
fn check_db_params(barrier_interval_ms: Option<u64>) -> Result<(), String> {
if let Some(v) = barrier_interval_ms {
if v == 0 || v > i32::MAX as u64 { return Err(format!("barrier_interval_ms {} out of range", v)); }
}
Ok(())
} Type guard
fn fits_i32(v: u64) -> Option<i32> { i32::try_from(v).ok() } Try / catch
match controller.create_database(db).await {
Err(e) if e.to_string().contains("out of range") => return Err(UserInputError(e.to_string())),
other => other,
} Prevention
- Validate units (ms) and magnitude in IaC templates before CREATE DATABASE.
- Reuse the same OverrideValidate helpers client-side when available.
- Centralize database parameter defaults instead of hardcoding per environment.
When it happens
Trigger: Calling CREATE DATABASE ... WITH ( barrier_interval_ms = <out-of-range> ) or the create_database catalog API with a PbDatabase whose barrier_interval_ms field is outside the accepted range.
Common situations: Provisioning databases from IaC/scripts with wrong-unit values (seconds vs milliseconds); very large ms values exceeding i32; copy-pasted tenant configs with invalid values.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- value {:?} out of range, expect {:?}
- since_timestamp is not before the committed epoch of upstrea
- since_timestamp is too new for upstream table {}: requested
- only iceberg table can be altered as sink
- Invalid parameter: {0}
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/b4b15492c48fb9a5.
Report an issue: GitHub.