risingwavelabs/risingwave · error · SessionConfigError

Invalid value `{value}` for `{entry}`

Error message

Invalid value `{value}` for `{entry}`

What it means

`SessionConfigError::InvalidValue` is raised when a value assigned to a session config entry (a Postgres-style GUC such as `search_path` or `server_encoding`) fails that entry's value validation; the source field keeps the underlying parse/validation error.

Source

Thrown at src/common/src/session_config/mod.rs:54

pub use statement_timeout::StatementTimeout;
use thiserror::Error;

use self::non_zero64::ConfigNonZeroU64;
use crate::config::mutate::TomlTableMutateExt;
use crate::config::streaming::{CacheRefillPolicy, JoinEncodingType, OverWindowCachePolicy};
use crate::config::{ConfigMergeError, StreamingConfig, merge_streaming_config_section};
use crate::hash::VirtualNode;
use crate::session_config::parallelism::{ConfigBackfillParallelism, ConfigParallelism};
use crate::session_config::sink_decouple::SinkDecouple;
use crate::session_config::transaction_isolation_level::IsolationLevel;
pub use crate::session_config::visibility_mode::VisibilityMode;
use crate::{PG_VERSION, SERVER_ENCODING, SERVER_VERSION_NUM, STANDARD_CONFORMING_STRINGS};

pub const SESSION_CONFIG_LIST_SEP: &str = ", ";

#[derive(Error, Debug)]
pub enum SessionConfigError {
    #[error("Invalid value `{value}` for `{entry}`")]
    InvalidValue {
        entry: &'static str,
        value: String,
        source: anyhow::Error,
    },

    #[error("Unrecognized config entry `{0}`")]
    UnrecognizedEntry(String),
}

type SessionConfigResult<T> = std::result::Result<T, SessionConfigError>;

const AUTO_LOCALITY_BACKFILL_MIN_SIZE: u64 = 10 * 1024 * 1024 * 1024;

fn default_auto_locality_backfill_min_size() -> u64 {
    AUTO_LOCALITY_BACKFILL_MIN_SIZE
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Check the valid value set for the specific entry and re-issue SET with a correct value.
  2. Read the `source` field of the error for the underlying validation failure detail.
  3. If the setting is Postgres-only and not implemented, avoid setting it or use a supported alternative.
  4. For applications, wrap SET commands with error handling and fall back to defaults.

Example fix

-- before
SET timezone TO 'invalid-zone';
-- after
SET timezone TO 'UTC';
Defensive patterns

Strategy: try-catch

Validate before calling

-- validate value against entry's allowed set before SET
def valid_value(entry, value) { return KNOWN_GUC_VALUES[entry].contains(value); }

Try / catch

match session.set_config(entry, value) {
    Err(SessionConfigError::InvalidValue { entry, source, .. }) =>
        eprintln!("bad value for {entry}: {source}"),
    Err(e) => return Err(e.into()),
    Ok(_) => {}
}

Prevention

When it happens

Trigger: Executing `SET <entry> = <value>` (or `set_config`) in a RisingWave session where the entry name is known but the value fails validation — e.g. `SET TIME ZONE 'bogus'` or an invalid value for `search_path`/`standard_conforming_strings`.

Common situations: Typo'd or invalid GUC values in psql sessions; application connection strings setting invalid session variables; scripts ported from Postgres using values RisingWave's stricter validator rejects.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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