risingwavelabs/risingwave · error · SinkError::Config

Cannot find ` ` (stream value type)

Error message

Cannot find `{VALUE_FORMAT}` (stream value type)

What it means

In the Redis stream value-type branch, `validate` requires `value format` (a template string for encoding the row value) in the format descriptor options. Missing it aborts validation with this config error, since the stream entry value cannot be built without a template.

Solutions

  1. Add `value format = '<template>'` (e.g. `'{{col1}}-{{col2}}'`) to the sink options.
  2. Check the key is spelled exactly `value format`.
  3. Confirm the template placeholders match actual column names so TemplateStringEncoder validation passes.

Example fix

// before
WITH (connector='redis', value type='stream', stream='events')
// after
WITH (connector='redis', value type='stream', stream='events', value format='{{event}}')
Defensive patterns

Strategy: validation

Validate before calling

if (opts['value type'] === 'stream' && !opts['value format']) throw new Error('stream sink requires value format template');

Try / catch

try { await createSink(cfg); } catch (e) { if (/Cannot find `value format`/.test(String(e))) { cfg['value format'] = defaultTemplate(cfg); await createSink(cfg); } else throw e; }

Prevention

When it happens

Trigger: Create a sink with `value type='stream'`, valid `stream`/`stream column`, but no `value format` option.

Common situations: Users supply `key format` but forget `value format`; configs copied from geo/string examples that use different required options; misspelled option keys.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at src/connector/src/sink/redis.rs:473

                        || (stream.is_some() && stream_column.is_some())
                    {
                        return Err(SinkError::Config(anyhow!(
                            "Please specific either `{STREAM}` or `{STREAM_COLUMN}`. They are mutually exclusive options."
                        )));
                    }

                    if let Some(stream_column) = stream_column
                        && let Some(stream_column_type) = all_map.get(stream_column)
                        && (stream_column_type != &DataType::Varchar)
                    {
                        return Err(SinkError::Config(anyhow!(
                            "`{STREAM_COLUMN}` must be set to `varchar`"
                        )));
                    }

                    let value_format =
                        self.format_desc.options.get(VALUE_FORMAT).ok_or_else(|| {
                            SinkError::Config(anyhow!("Cannot find `{VALUE_FORMAT}`"))
                        })?;
                    let key_format = self.format_desc.options.get(KEY_FORMAT).ok_or_else(|| {
                        SinkError::Config(anyhow!(
                            "Cannot find '{KEY_FORMAT}', please set it or use JSON"
                        ))
                    })?;
                    TemplateStringEncoder::check_string_format(key_format, &pk_map)?;
                    TemplateStringEncoder::check_string_format(value_format, &all_map)?;
                }
                _ => {
                    return Err(SinkError::Config(anyhow!(
                        "`{REDIS_VALUE_TYPE}` must be set to `{REDIS_VALUE_TYPE_STRING}` or `{REDIS_VALUE_TYPE_GEO}` or `{REDIS_VALUE_TYPE_PUBSUB}` or `{REDIS_VALUE_TYPE_STREAM}`"
                    )));
                }
            }
        }
        self.config.common.build_conn_and_pipe().await?;
        Ok(())

View on GitHub (pinned to 6469eb736d)