risingwavelabs/risingwave · error · anyhow::Error

No properties provided to update

Error message

No properties provided to update

What it means

Guard in alter_source_properties_safe: after parsing the props JSON object, an empty map means there is nothing to update, so the operation is rejected rather than performing a pointless pause/update/resume cycle on the source. The faulty input is an empty JSON object `{}` for props.

Solutions

  1. Pass a non-empty JSON object of properties, e.g. '{"broker.endpoint":"host:9092"}'
  2. Check the variable feeding props_json is populated before invoking the command
  3. If no change is intended, skip calling the alter command entirely

Example fix

// before
alter_source_properties_safe(ctx, id, "{}", false)
// after
alter_source_properties_safe(ctx, id, "{\"broker.endpoint\":\"broker:9092\"}", false)
Defensive patterns

Strategy: validation

Validate before calling

let props: HashMap<String, String> = serde_json::from_str(&props_json)?;
if props.is_empty() {
    return Err(anyhow!("props must contain at least one key"));
}

Prevention

When it happens

Trigger: Calling the alter-source-properties command with a JSON object that has no keys (e.g. '{}') or JSON that deserializes to an empty map.

Common situations: Empty string or '{}' from a variable that was never populated; forgetting the props argument in a script.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/1ffd91ef5f2d745f. Report an issue: GitHub.

Appendix: source

Thrown at src/ctl/src/cmd_impl/meta/source_props.rs:41

///
/// This is a safe way to update source properties that:
/// 1. Pauses the source (already commits state)
/// 2. Updates catalog and propagates changes
/// 3. Optionally resets split assignments
/// 4. Resumes the source
pub async fn alter_source_properties_safe(
    context: &CtlContext,
    source_id: u32,
    props_json: String,
    reset_splits: bool,
) -> Result<()> {
    let meta_client = context.meta_client().await?;

    let props: HashMap<String, String> =
        serde_json::from_str(&props_json).context("Failed to parse props as JSON object")?;

    if props.is_empty() {
        return Err(anyhow!("No properties provided to update"));
    }

    println!("=== ALTER SOURCE PROPERTIES (SAFE) ===");
    println!("Source ID: {}", source_id);
    println!("Properties to update: {:?}", props);
    println!("Reset splits: {}", reset_splits);
    println!();

    println!("WARNING: This operation will pause the source during the update.");
    if reset_splits {
        println!("WARNING: Split reset requested - this may cause data duplication or loss!");
    }
    println!();

    meta_client
        .alter_source_properties_safe(
            SourceId::from(source_id),
            props.into_iter().collect(),

View on GitHub (pinned to 6469eb736d)